fix proxy deprecated post#12122
Conversation
|
Hey @RayBB , PR is ready for review whenever you have bandwidth! |
RayBB
left a comment
There was a problem hiding this comment.
Looks like a great start. Let's use httpx instead of requests. Also, please add a video of the reading goals setting working in the local app. It's great to see screenshots of the request but it's better to see the actual GUI working.
Thanks!
|
Also, I think we'll want to set a different x served by header to indicate that it's a proxy for the fastapi server. |
|
Hey @RayBB, I've addressed your feedback:
Let me know if anything else needs to be changed! |
a7a326e to
e5f2753
Compare
RayBB
left a comment
There was a problem hiding this comment.
Mostly looking good. Two small things to fix. Seems to work locally!
RayBB
left a comment
There was a problem hiding this comment.
Tested locally, it's working excellently.
Fixes a very annoying issue we were having locally around redirects.
Appreciate your help here!
|
Happy to help! looking forward to the next one :) |
Closes #12121
Technical
Modified
deprecated_handler.pyto proxy POST requests to thefast_webcontainer (
http://fast_web:8080) instead of using a 303 redirect in thelocal dev environment. GET requests continue to use the existing redirect
behavior. A new
proxy_to_fastapi()function handles forwarding all headers,cookies, and request body, and returns the response via
delegate.RawTextto bypass the web.py layout processor.
Testing
make git && docker compose up -dcurl -i -X POST http://localhost:8080/reading-goal.json \ -d '{"year":2024}' \ -H "Content-Type: application/json"Expected:
200 OKwithx-served-by: FastAPIin the headers.Expected:
303 See OtherwithLocation: http://localhost:18080/reading-goal.jsonScreenshot
GET request (redirected to :18080):


POST request (proxied to FastAPI):
Stakeholders
@RayBB