|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59698 Redirects does not work as expected when using POST or PUT
Submitted: 2011-04-04 10:02 UTC Modified: 2011-05-13 20:16 UTC
From: djpate at gmail dot com Assigned: jawed (profile)
Status: Closed Package: oauth (PECL)
PHP Version: 5.3.1 OS: Ubuntu 10.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: djpate at gmail dot com
New email:
PHP Version: OS:


 [2011-04-04 10:02 UTC] djpate at gmail dot com
Hello again,

I'm writing a code to integrate google calendar api and I struggled to modify an Event using their API to finally realize that the problem came from the automatic redirect.

Reproduce code:
//This should work but doesn't


//The working fix

				$info = $this->oauth->getLastResponseInfo();
				if($info['http_code'] == 302){


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-05 03:55 UTC] djpate at gmail dot com
The same bug appears when using DELETE method.
 [2011-04-13 12:10 UTC] hugh dot lomas at lodestarbpm dot com
I have had the same issue, and was going to submit a bug 

I noticed that my POST submissions, when redirected, were 
being changed to GET methods when following the redirect.

After digging around for a long time, I found lines 1740-
1759 of OAuth.c in 1.1.0:
if (soo->redirects >= OAUTH_MAX_REDIRS) {
} else {
    oauth_apply_url_redirect(&surl, soo-
    final_http_method = OAUTH_HTTP_METHOD_GET;

I'm not completely familiar with C or this code base, but it 
appears to me that the main suspect is line 1758, where it 
is setting the method to GET. 

In the context of the function, this appears that any time a 
redirect is followed, it defaults to GET.

This is a problem for me since I have to use a workaround 
similar to what djpate posted.
 [2011-04-13 13:29 UTC]
Thx, I'll take this.

- JJ
 [2011-05-13 20:16 UTC]
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

Please try again on trunk
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 03 08:01:29 2023 UTC