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

Response headers affectation #323

Closed
furanzujin opened this issue Apr 24, 2023 · 2 comments · Fixed by #330
Closed

Response headers affectation #323

furanzujin opened this issue Apr 24, 2023 · 2 comments · Fixed by #330

Comments

@furanzujin
Copy link
Contributor

Hello,

We encountered a crash of the HTTP gateway during the assignment of the response headers.
This error occurred because of invalid characters in one of the header keys.

Several ways have been identified to avoid this crash:

  • sanitizing the keys/values at assignment time in the $responseHeaders variable
  • sanitizing the keys/values through the onAfterCall hook

However, we believe that crashes could be avoided more globally by securing the sendResponse and sendError processes.

Do you want us to propose a change to the moleculer-web component to implement these operations?
If so, we would like to include a log (warn or error) and skip the assignment of the problematic header.

Would this be acceptable to you?

@icebob
Copy link
Member

icebob commented May 1, 2023

Yeah, please create a PR with your proposed fix.

@furanzujin
Copy link
Contributor Author

Hello @icebob,

Sorry for the delay; you'll find a pull request here to avoid process crashes on invalid header character assignments.

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 a pull request may close this issue.

2 participants