We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Say I have a test API that echos back the URI path that was called.
Note: API is running on 3000
$ curl http://localhost:3000/api CALLED: /api $ curl http://localhost:3000/api/ CALLED: /api/
When setting up Trunk to proxy to this endpoint it proxies to /api/ when when the original path was /api.
/api/
/api
$ trunk --version trunk 0.14.0 $ trunk serve --proxy-backend http://localhost:3000/api ... Mar 05 15:23:02.819 INFO 📡 proxying /api -> http://localhost:3000/api Mar 05 15:23:02.819 INFO 📡 server listening at 0.0.0.0:8080 $ curl http://localhost:8080/api CALLED: /api/ $ curl http://localhost:8080/api/ CALLED: /api/
Not the biggest deal by itself but my actual API server is set to redirect /api/ to /api which causes proxying to fail.
# calling the "actual" API server now $ curl http://localhost:3000/api CALLED: /api $ curl -v http://localhost:3000/api/ ... < HTTP/1.1 308 Permanent Redirect < location: /api ... # calling via Trunk $ curl -v http://localhost:8080/api ... < HTTP/1.1 308 Permanent Redirect < location: /api ... $ curl -v http://localhost:8080/api/ ... < HTTP/1.1 308 Permanent Redirect < location: /api ...
PS: thanks for the amazing project, it's honestly a lifesaver. Makes working with WASM an absolute joy tbh.
The text was updated successfully, but these errors were encountered:
I had trouble with this issue too. 🥺 This is an extraneous feature. I think It is better to optional and could be disabled as standard.
Sorry, something went wrong.
FWIW, it seems to only happen when proxying requests to the root redirect.
Assuming trunk serve --proxy-backend http://localhost:3000/api, then:
trunk serve --proxy-backend http://localhost:3000/api
curl http://localhost:8080/api
http://localhost:3000/api/
curl http://localhost:8080/api/foobar
http://localhost:3000/api/foobar
Successfully merging a pull request may close this issue.
Say I have a test API that echos back the URI path that was called.
When setting up Trunk to proxy to this endpoint it proxies to
/api/
when when the original path was/api
.$ trunk --version trunk 0.14.0 $ trunk serve --proxy-backend http://localhost:3000/api ... Mar 05 15:23:02.819 INFO 📡 proxying /api -> http://localhost:3000/api Mar 05 15:23:02.819 INFO 📡 server listening at 0.0.0.0:8080 $ curl http://localhost:8080/api CALLED: /api/ $ curl http://localhost:8080/api/ CALLED: /api/
Not the biggest deal by itself but my actual API server is set to redirect
/api/
to/api
which causes proxying to fail.PS: thanks for the amazing project, it's honestly a lifesaver. Makes working with WASM an absolute joy tbh.
The text was updated successfully, but these errors were encountered: