Skip to content

Fix HTTP request cancellation propagation to upstream - #76

Merged
fsul7o merged 2 commits into
AthenZ:masterfrom
gyakami:fix/http-request-context-cancellation
Sep 17, 2026
Merged

fsul7o merged 2 commits into
AthenZ:masterfrom
gyakami:fix/http-request-context-cancellation

Conversation

@gyakami

@gyakami gyakami commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description

Preserve the incoming HTTP request context when the reverse proxy creates a request for the upstream server.

The proxy previously used http.NewRequest, which creates a request with a background context. As a result, cancellation of the incoming request, such as when a client disconnects, was not propagated to the upstream request and the upstream application could continue processing it.

This change uses http.NewRequestWithContext with the incoming request context. It also adds a regression test that verifies cancellation is preserved after the proxy director rewrites the request.

Testing

  • go test ./...

Type of change

  • Bug fix
  • New feature
  • Refactoring (no functional changes, no api changes)
  • Non-code changes (update documentation, pipeline, etc.)

Flags

  • Breaks backward compatibility
  • Requires a documentation update
  • Has untestable code

Checklist

  • Followed the guidelines in the CONTRIBUTING document
  • Added prefix [skip ci]/[ci skip]/[no ci]/[skip actions]/[actions skip] in the PR title if necessary
  • Tested and linted the code
  • Commented the code (no additional comments were required for this change)
  • Made corresponding changes to the documentation (not required; there are no user-facing interface changes)
  • Passed all pipeline checking

Checklist for maintainer

  • Use Squash and merge
  • Double-confirm the merge message has prefix [skip ci]/[ci skip]/[no ci]/[skip actions]/[actions skip]
  • Delete the branch after merge

@fsul7o
fsul7o merged commit 07c48a0 into AthenZ:master Sep 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants