Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
08f8917a
Commit
08f8917a
authored
23 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Dirk Manske's fix for HTTP response code 301, that now behaves more like
browsers do. Which thus *breaks* the RFC 2616...
parent
62d205a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/transfer.c
+21
-1
21 additions, 1 deletion
lib/transfer.c
with
21 additions
and
1 deletion
lib/transfer.c
+
21
−
1
View file @
08f8917a
...
...
@@ -1262,7 +1262,6 @@ CURLcode Curl_perform(struct SessionHandle *data)
*/
switch
(
data
->
info
.
httpcode
)
{
case
300
:
/* Multiple Choices */
case
301
:
/* Moved Permanently */
case
306
:
/* Not used */
case
307
:
/* Temporary Redirect */
default:
/* for all unknown ones */
...
...
@@ -1270,6 +1269,27 @@ CURLcode Curl_perform(struct SessionHandle *data)
* seem to be OK to POST to.
*/
break
;
case
301
:
/* Moved Permanently */
/* (quote from RFC2616, section 10.3.2):
*
* Note: When automatically redirecting a POST request after
* receiving a 301 status code, some existing HTTP/1.0 user agents
* will erroneously change it into a GET request.
*
* ----
* Warning: Because most of importants user agents do this clear
* RFC2616 violation, many webservers expect this misbehavior. So
* these servers often answers to a POST request with an error page.
* To be sure that libcurl gets the page that most user agents
* would get, libcurl has to force GET:
*/
if
(
data
->
set
.
httpreq
==
HTTPREQ_POST
||
data
->
set
.
httpreq
==
HTTPREQ_POST_FORM
)
{
infof
(
data
,
"Violate RFC 2616/10.3.2 and switch from POST to GET
\n
"
);
data
->
set
.
httpreq
=
HTTPREQ_GET
;
}
break
;
case
302
:
/* Found */
/* (From 10.3.3)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment