-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Problems with proxying chunked encoding from rails server #50
Comments
This also happened to me. I got a bad
|
I solved this issue with
|
@tirumaraiselvan actually defining |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am having a problem with proxying json with chunked encoding in the header.
It appears that the body is never sent. I have no idea how to fix this, and cant be bothered finding out what chunked encoding is (streaming..?). A quick look at it, this rack/rack#396 indicates that the body needs to be yielded, but I dont have time to have a look into this.
a quick fix for this is to remove the header:
in call(env) assuming a ret var
ret[1].delete 'transfer-encoding' if ret.length > 1
Here is the output from wget -S (save headers) from the proxy server, and the original server:
proxied:
HTTP/1.1 200 OK
Date: Wed, 04 Feb 2015 02:00:22 GMT
Status: 200 OK
Connection: close
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Ua-Compatible: chrome=1
Content-Type: application/json; charset=utf-8
Etag: "208b8efe53ef1664e9c91c244afc42e1"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e06a103d-00a8-41bf-80ce-f094546654db
X-Runtime: 0.025867
Transfer-Encoding: chunked
Server: WEBrick/1.3.1 (Ruby/2.0.0/2014-11-13)
unproxied:
HTTP/1.1 200 OK
Date: Wed, 04 Feb 2015 02:00:52 GMT
Status: 200 OK
Connection: close
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: chrome=1
Content-Type: application/json; charset=utf-8
ETag: "208b8efe53ef1664e9c91c244afc42e1"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: d2ad9565-7648-4e10-9387-83052b069cca
X-Runtime: 0.029753
Transfer-Encoding: chunked
[{"id":1,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","job_date":"2015-02-03T00:00:00.000Z","address":null,"total":null,"client_id":1,"extras":null,"comments":null,"private_comments":null,"job_date_end":"2015-02-04T00:00:00.000Z","client":{"id":1,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","name":"Elna Ernser","date":null,"address":"992 Harber Field","work_phone":null,"home_phone":null,"mob_phone":null,"fax":null,"phones":null,"email":null},"groups":[]},{"id":2,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","job_date":"2015-02-03T00:00:00.000Z","address":null,"total":null,"client_id":2,"extras":null,"comments":null,"private_comments":null,"job_date_end":"2015-02-04T00:00:00.000Z","client":{"id":2,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","name":"Ewell Fritsch","date":null,"address":"9854 Courtney Keys","work_phone":null,"home_phone":null,"mob_phone":null,"fax":null,"phones":null,"email":null},"groups":[]},{"id":3,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","job_date":"2015-02-03T00:00:00.000Z","address":null,"total":null,"client_id":3,"extras":null,"comments":null,"private_comments":null,"job_date_end":"2015-02-04T00:00:00.000Z","client":{"id":3,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","name":"Vincenza Block DDS","date":null,"address":"3278 Dickens Parks","work_phone":null,"home_phone":null,"mob_phone":null,"fax":null,"phones":null,"email":null},"groups":[]},{"id":4,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","job_date":"2015-02-03T00:00:00.000Z","address":null,"total":null,"client_id":4,"extras":null,"comments":null,"private_comments":null,"job_date_end":"2015-02-04T00:00:00.000Z","client":{"id":4,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","name":"Elena Turcotte V","date":null,"address":"9891 Schowalter Manor","work_phone":null,"home_phone":null,"mob_phone":null,"fax":null,"phones":null,"email":null},"groups":[]},{"id":5,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","job_date":"2015-02-03T00:00:00.000Z","address":null,"total":null,"client_id":5,"extras":null,"comments":null,"private_comments":null,"job_date_end":"2015-02-04T00:00:00.000Z","client":{"id":5,"created_at":"2015-02-03T08:15:01.000Z","updated_at":"2015-02-03T08:15:01.000Z","name":"Mr. Retha O'Connell","date":null,"address":"12506 Hermann Pine","work_phone":null,"home_phone":null,"mob_phone":null,"fax":null,"phones":null,"email":null},"groups":[]}]
The text was updated successfully, but these errors were encountered: