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

rewrite module and secure cookies #141

Closed
5im-0n opened this issue Jan 29, 2020 · 5 comments · Fixed by lwsjs/rewrite#9
Closed

rewrite module and secure cookies #141

5im-0n opened this issue Jan 29, 2020 · 5 comments · Fixed by lwsjs/rewrite#9

Comments

@5im-0n
Copy link

5im-0n commented Jan 29, 2020

When rewriting happens with an https destination, like in ws --rewrite '/:user/repos/:name -> https://api.github.com/repos/:user/:name', cookies set by the destination are usually set with the secure flag, but since lws listens on http, this cookie gets lost.
lws should strip the secure flag from the cookie, so cookies set from an https origin get set correctly.

@75lb
Copy link
Member

75lb commented Feb 2, 2020

Hi, thanks for the feature - do you think it should be on by default?

@5im-0n
Copy link
Author

5im-0n commented Feb 2, 2020

Yes I think so. Since lws is "A lean, modular web server for rapid full-stack development." I think it should be on in the default use case, that is, development.

@75lb
Copy link
Member

75lb commented Feb 3, 2020

yeah, i agree.. the only concern is that making this behaviour the default could surprise existing users accustomed to the previous behaviour.. It's a breaking change, unless people consider it a bug fix and not feature addition..

@5im-0n 5im-0n closed this as completed Feb 4, 2020
@5im-0n 5im-0n reopened this Feb 4, 2020
@5im-0n
Copy link
Author

5im-0n commented Feb 4, 2020

True. But I think that since it did not work before, nobody used lws this way, so there should be no breaking changes for anyone.

@75lb
Copy link
Member

75lb commented Feb 4, 2020

Released in lws-rewrite v2.1.0. Reinstall local-web-server to pick up the change.

On insecure connections (plain HTTP), stripping the secure attribute from remote, rewrite-target cookies is now the default behaviour. Set the --rewrite.keep-secure-attr to disable this.

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