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

How to set max http header size in create react app #6582

Closed
ghost opened this issue Mar 6, 2019 · 6 comments
Closed

How to set max http header size in create react app #6582

ghost opened this issue Mar 6, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 6, 2019

I assume create react app is using web pack dev server.
I would like to be able to specify http header size for it, but can't seem to find a way to do it. Can someone help?

If I am right I basically need to pass some command line parameters (related to setting http header max size) to the nodejs server which web pack dev server is running. But can't find a way to do it.

@ghost ghost changed the title How to set header size in create react app How to set http header size in create react app Mar 6, 2019
@ghost ghost changed the title How to set http header size in create react app How to set max http header size in create react app Mar 6, 2019
@heyimalex
Copy link
Contributor

Why do you need this if you don't mind me asking?

@ghost
Copy link
Author

ghost commented Mar 7, 2019

@heyimalex We use single sign on, which attaches user roles in header, and when the roles are too many, it exceeds header size limit.

@heyimalex
Copy link
Contributor

How large are these headers? I couldn't find anything searching for webpack stuff, but it looks like node has a hard limit of 80kb.

@ghost
Copy link
Author

ghost commented Mar 13, 2019

AFAIK you can customize limit for node using command line parameters when invoking node, so we were looking for way how to pass that parameter to node instance which web pack dev server is running.

@heyimalex
Copy link
Contributor

heyimalex commented Mar 13, 2019

Oh yeah, I just found an issue about it. Well the react-scripts bin looks like it passes though the flags after your command straight to node, so you should be able to change your build script to react-scripts --max-http-header-size=77777 start?

@ghost
Copy link
Author

ghost commented Mar 13, 2019

For some reason it didn't work, we went with other solution, reduce header size for some users. Maybe your post can be useful for someone else.

@ghost ghost closed this as completed Mar 13, 2019
@lock lock bot locked and limited conversation to collaborators Mar 18, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant