Proxy POST requests for deprecated endpoints in dev env
Problem
When a deprecated web.py endpoint receives a POST request in the local dev environment, it fails because the 303 redirect doesn't preserve the request body and headers. This affects any POST request to a deprecated endpoint, currently breaking the "set yearly reading goal" feature on localhost.
Reproducing the bug
- Start the local dev environment with
make git && docker compose up -d - Send a POST request to a deprecated endpoint:
curl -i -X POST http://localhost:8080/reading-goal.json \
-d '{"year":2024}' \
-H "Content-Type: application/json"
- Observe that the request fails — the 303 redirect drops the POST body and headers
Expected behavior: POST requests to deprecated endpoints should be forwarded to the fast_web container and return the correct response.
Actual behavior: POST requests fail because the 303 redirect drops the request body and headers, causing the request to not reach the fast_web container correctly.
Context
- OS: Linux
- Environment: (dev/local)
- The
fast_webcontainer is accessible internally viahttp://fast_web:8080 - GET requests to deprecated endpoints work correctly via redirect
Breakdown
Implementation Details (for maintainers)
Requirements Checklist
- [ ]
Related files
Stakeholders
@RayBB
Instructions for Contributors
- Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Note: this is blocking: https://github.com/internetarchive/openlibrary/pull/11895