Skip to content

default to NONE for PostRedirectFlags#1285

Merged
COM8 merged 2 commits into
libcpr:masterfrom
transmissions11:patch-1
Feb 15, 2026
Merged

default to NONE for PostRedirectFlags#1285
COM8 merged 2 commits into
libcpr:masterfrom
transmissions11:patch-1

Conversation

@transmissions11

@transmissions11 transmissions11 commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

this unfortunately may be breaking for some users, so if strong backwards compatibility is important maybe wait to include this in a major release or disregard it entirely, but:

both libcurl and python's requests library do not preserve POST on redirects for 301/302/303 statuses by default (see https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html). this is crucial for various common OAuth/SAML flows which expect GET requests after redirects.

given this behavior is the default in other widely-used environments (notably browsers as well), and particularly because cpr aims to be a "spiritual port" of requests, i believe NONE is a much more sensible default than POST_ALL.

@transmissions11 transmissions11 changed the title default to none for PostRedirectFlags default to NONE for PostRedirectFlags Jan 8, 2026
@transmissions11

Copy link
Copy Markdown
Contributor Author

ah sorry looks like i'd need to update some tests, if you think you'd be willing to merge i can go ahead and fix them

@COM8 COM8 added the Breaking Change 🔥 This change will most likely break consuming applications. label Jan 19, 2026
@COM8

COM8 commented Jan 19, 2026

Copy link
Copy Markdown
Member

@transmissions11 thanks for submitting this!

Yes, I'm willing to merge this. We just have to clearly state this change in the changelog when doing the next release.

@transmissions11

transmissions11 commented Jan 31, 2026

Copy link
Copy Markdown
Contributor Author

sorry, missed your reply! tests should be good now — failing ci checks seem unrelated to my patch

@COM8 COM8 merged commit f0574bf into libcpr:master Feb 15, 2026
34 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Change 🔥 This change will most likely break consuming applications.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants