Skip to content

default to NONE for PostRedirectFlags#1285

Open
transmissions11 wants to merge 2 commits intolibcpr:masterfrom
transmissions11:patch-1
Open

default to NONE for PostRedirectFlags#1285
transmissions11 wants to merge 2 commits intolibcpr:masterfrom
transmissions11:patch-1

Conversation

@transmissions11
Copy link

@transmissions11 transmissions11 commented Jan 8, 2026

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
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
Copy link
Member

COM8 commented Jan 19, 2026

@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
Copy link
Author

transmissions11 commented Jan 31, 2026

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

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