Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST parameters are not passed along correctly #7

Open
drewwells opened this issue Jan 26, 2011 · 1 comment
Open

POST parameters are not passed along correctly #7

drewwells opened this issue Jan 26, 2011 · 1 comment

Comments

@drewwells
Copy link

Reproduce:
$.post('url',
{a: 1, b:2 },
function(){
console.log(arguments);
});

Proxy is eating the data passed through and changing it.

Here's what the proxy looks like:

POST /catalog/j_spring_security_check HTTP/1.1
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13
Host: apollo.erdas.com
Accept: /
Content-Length: 258
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------60ac83a9a5b8

------------------------------60ac83a9a5b8
Content-Disposition: form-data; name="j_username"

pizza
------------------------------60ac83a9a5b8
Content-Disposition: form-data; name="j_password"

party
------------------------------60ac83a9a5b8--

Here's what it SHOULD look like:

POST /catalog/j_spring_security_check HTTP/1.1
Host: apollo.erdas.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13
Accept: /
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 37
Cookie: JSESSIONID=0E680034985149CC7001CDE5B2029FA9;
Pragma: no-cache
Cache-Control: no-cache

j_username=pizza&j_password=party

@wize-wiz
Copy link

Make sure to build the query, headers are never passed correctly, should be fixed but I don't think this is being maintained anymore.

change line 164:

curl_setopt( $ch, CURLOPT_POSTFIELDS, $_POST );

to

 curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query($_POST));

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

No branches or pull requests

2 participants