Skip to content

migrate to class - #271

Closed
sirenkovladd wants to merge 1 commit into
fastify:mainfrom
sirenkovladd:migrate-to-class
Closed

migrate to class#271
sirenkovladd wants to merge 1 commit into
fastify:mainfrom
sirenkovladd:migrate-to-class

Conversation

@sirenkovladd

Copy link
Copy Markdown
Contributor

migrate to class syntax (Chain, request, response)

copied class from #252
but without changing the logic in lib/do-inject.js (doInject) (to resolve Test Fastify Integration)

Checklist

@sirenkovladd sirenkovladd mentioned this pull request Oct 28, 2023
4 tasks

@jsumners jsumners left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎

Comment thread lib/response.js
Comment on lines +177 to +182
// TODO change this to use the header getter
const regex = new RegExp('\\r\\n' + name + ': ([^\\r]*)\\r\\n')
const [, value] = this._header.match(regex) || []
// const value = this.getHeader(name)
if (value) {
this._lightMyRequest.headers[name.toLowerCase()] = value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will the unit tests pass if you use the header getter?

@sirenkovladd sirenkovladd Oct 30, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean, this function is same as original

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not pass, these headers 'Data', 'Connection', 'Transfer-Encoding' do not exist

@sirenkovladd

Copy link
Copy Markdown
Contributor Author

@jsumners, Can you explain your negative attitude?

@jsumners

Copy link
Copy Markdown
Member

@sirenkovladd

Copy link
Copy Markdown
Contributor Author

@jsumners I'm not mentioning bun in this PR (since not all issues are resolved)
what happens in this PR is the grouping of the function into a class (it was already there, but it was Function.constructor I go to the class syntax)
on the contrary, it will be easier to maintain

@Uzlopak Uzlopak closed this Sep 26, 2025
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants