Comments (12)
Interesting. I wonder if these are happening at the heroku level or the app level.
from httpbin.
You can hit a direct tcp route to the app here: http://route.heroku.com:26966
from httpbin.
Interesting. The behavior is still slightly inaccurate:
>>> print requests.post('http://route.heroku.com:26966/post').content
{
"origin": "10.44.89.92",
"files": {},
"form": {},
"url": "http://route.heroku.com:26966/post",
"args": {},
"headers": {
"Content-Length": "",
"Accept-Encoding": "identity, deflate, compress, gzip",
"Accept": "*/*",
"User-Agent": "python-requests/0.12.0",
"Host": "route.heroku.com:26966",
"Content-Type": ""
},
"json": null,
"data": ""
}
So the headers dict contains an empty-string value for Content-length
. But the header is still not being set by Requests at all:
sendto(3, "POST /post HTTP/1.1\r\nHost: route.heroku.com:26966\r\nAccept-Encoding: identity, deflate, compress, gzip\r\nAccept: */*\r\nUser-Agent: python-requests/0.12.0\r\n\r\n", 154, 0, NULL, 0) = 154
from httpbin.
Interesting. I wonder if this is a wsgi bug or something to bring up with either gunicorn or werkzeug?
/cc @mitsuhiko, @benoitc
from httpbin.
Heh, the reported origin of 10.44.89.92
is now some sort of internal Heroku gateway? When I hit httpbin.org
directly, the reported origin is my own IP.
from httpbin.
Correct.
from httpbin.
The route.heroku.com
address produces the correct behavior for Connection: close
:
[shivaram@good-fortune ~/Documents]$ curl -v -H "Connection: close" http://httpbin.org/headers
* About to connect() to httpbin.org port 80 (#0)
* Trying 204.236.238.79... connected
* Connected to httpbin.org (204.236.238.79) port 80 (#0)
> GET /headers HTTP/1.1
> User-Agent: curl/7.21.7 (x86_64-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.3.0 zlib/1.2.5 libidn/1.22 libssh2/1.2.7
> Host: httpbin.org
> Accept: */*
> Connection: close
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Fri, 04 May 2012 04:00:48 GMT
< Server: gunicorn/0.13.4
< Content-Length: 280
< Connection: Close
<
{
"headers": {
"Content-Length": "",
"Connection": "keep-alive",
"Accept": "*/*",
"User-Agent": "curl/7.21.7 (x86_64-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.3.0 zlib/1.2.5 libidn/1.22 libssh2/1.2.7",
"Host": "httpbin.org",
"Content-Type": ""
}
* Closing connection #0
}[shivaram@good-fortune ~/Documents]$ curl -v -H "Connection: close" http://route.heroku.com:26966/headers
* About to connect() to route.heroku.com port 26966 (#0)
* Trying 107.20.247.209... connected
* Connected to route.heroku.com (107.20.247.209) port 26966 (#0)
> GET /headers HTTP/1.1
> User-Agent: curl/7.21.7 (x86_64-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.3.0 zlib/1.2.5 libidn/1.22 libssh2/1.2.7
> Host: route.heroku.com:26966
> Accept: */*
> Connection: close
>
< HTTP/1.1 200 OK
< Server: gunicorn/0.13.4
< Date: Fri, 04 May 2012 04:01:46 GMT
< Connection: close
< Content-Type: application/json
< Content-Length: 286
<
{
"headers": {
"Content-Length": "",
"Connection": "close",
"Accept": "*/*",
"User-Agent": "curl/7.21.7 (x86_64-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.3.0 zlib/1.2.5 libidn/1.22 libssh2/1.2.7",
"Host": "route.heroku.com:26966",
"Content-Type": ""
}
* Closing connection #0
}
So that one might be some sort of proxying issue.
from httpbin.
I was the person originally bit by the issue, trying to debug Requests. Apart from this niggle, great service :)
from httpbin.
WSGI can't work without content length so Werkzeug assumes that if the content length is not provided the request wanted to transmit no data at all. Regarding the keep alive behavior: that one is controlled by the WSGI server. The application is explicitly not allowed to control that.
from httpbin.
About the content-length : that's not totally true
http://www.python.org/dev/peps/pep-3333/#handling-the-content-length-header
from httpbin.
@benoitc this is referring to the outgoing content length header, not the incoming one.
from httpbin.
Sounds like nothing httpbin can do here then? Close able?
from httpbin.
Related Issues (20)
- Does httpbin.org response ping request?
- DOM XSS due to old SwaggerUI version
- multipart/form-data requests of multiple files on the same parameter are not returned
- docker build fails
- Docker build fails with python dependency error
- Can we check Latency less than 1 second in httpbin
- readme file does not explain what this service does HOT 2
- Question: Is there reason for not using smaller Alpine based python as base image for httpbin HOT 1
- Multipart form with JSON returned as JSON string
- Any plans to updated the SSL certificate? HOT 1
- Include Spec.Json Link
- Digest authentication algorithm parameter not working
- Can't get a response using Set-Cookie header ? HOT 1
- State of Maintenance HOT 24
- If anyone's lookiing for an alternative... HOT 5
- 504 Gateway Time-out http://httpbin.org/ip
- Decode JWT in "Authentication: Bearer ..." request header
- RFE: replace `raven` by `sentry` HOT 1
- RFE: please provide update for `werkzeug` 3.0.x
- A similar project for those who might need
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpbin.