Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to class #271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sirenkovladd
Copy link
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
Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

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

👎

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
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?

Copy link
Contributor Author

@sirenkovladd sirenkovladd Oct 30, 2023

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
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
Contributor Author

@jsumners, Can you explain your negative attitude?

@jsumners
Copy link
Member

@sirenkovladd
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants