Skip to content

Proxy POST requests for deprecated endpoints in dev env #12121

@bhardwajparth51

Description

@bhardwajparth51

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

  1. Start the local dev environment with make git && docker compose up -d
  2. 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"
  1. 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_web container is accessible internally via http://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.

Metadata

Metadata

Labels

Lead: @RayBBIssues overseen by Ray (Onboarding & Documentation Lead) [manages]Module: FastAPINeeds: BreakdownThis big issue needs a checklist or subissues to describe a breakdown of work. [managed]Priority: 2Important, as time permits. [managed]Type: BugSomething isn't working. [managed]

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions