Skip to content

fix(client): reject redirects that change request methods - #77

Open
efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:efe/preserve-redirect-method
Open

efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:efe/preserve-redirect-method

Conversation

@efegokdemir

Copy link
Copy Markdown
Contributor

HTTP 301/302/303 redirects could turn writes and database deletions into GET requests, then report success if the redirected endpoint returned 2xx. Reject redirects that change the original HTTP method while retaining GET redirects, replayable 307/308 requests and the ten-redirect limit. Regression tests cover the client and all three write input formats.

Verified on macOS arm64 with Go 1.27.1: go test -race -count=1 ./..., go vet ./..., go build ./..., gofmt -l . and git diff --check passed. The new tests reproduced the false success before the fix. Linux CI and the GoReleaser snapshot have not been run locally.

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.

1 participant