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

add proxy option no_redirect #859

Merged
merged 2 commits into from
Aug 28, 2024
Merged

add proxy option no_redirect #859

merged 2 commits into from
Aug 28, 2024

Conversation

rksm
Copy link
Contributor

@rksm rksm commented Aug 27, 2024

When serving responses with the Trunk proxy, redirects are automatically followed by default. This can be undesirable, e.g. when serving a login page that responds with a redirect and a set-cookie header like

HTTP/1.1 303 See Other
location: /
set-cookie: session=...; ...;

With the default proxy settings, the set-cookie header is simply ignored.

This PR adds a proxy option no_redirect that when set will instruct the proxy to not automatically follow redirects. The default behavior is unchanged.

When serving responses with the Trunk proxy, redirects are automatically
followed by default. This can be undesirable, e.g. when serving a login page
that response with a redirect and a set-cookie header like

```
HTTP/1.1 303 See Other
location: /
set-cookie: session=...; ...;
```

This PR adds a proxy option `no_redirect` that when set will instruct the proxy
to not automatically follow redirects. The default behavior is unchanged.
@ctron
Copy link
Collaborator

ctron commented Aug 28, 2024

It might be the CI fails because the schema needs to be re-generated: https://github.com/trunk-rs/trunk/blob/main/CONTRIBUTING.md#hacking

@ctron ctron added the enhancement New feature or request label Aug 28, 2024
@ctron ctron merged commit 393eb04 into trunk-rs:main Aug 28, 2024
60 checks passed
@pablosichert pablosichert deleted the proxy-option-no-redirect branch August 30, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants