Using url_for is useful if httpbin is served under a prefix path. For
example, we can serve httpbin under http://example.org/httpbin.
Previously, we have to replace all hard coded paths, which produces
many diffs, and it makes hard to upgrade httpbin from source. This
commit uses url_for to resolve correct path even if prefix path is
used. For digest auth, we have to prepend request.script_root to
request.path to pass authentication.
At Runscope we use Bugsnag to track application exceptions. This commit allows
you to use Bugsnag to track httpbin exceptions. If you want to do this, you'll
need to set the environment variable BUGSNAG_API_KEY and optionally set the
variable BUGSNAG_RELEASE_STAGE. You'll also need to install the Python client
for Bugsnag, with `pip install bugsnag`.
This endpoint conforms to RFC7233.
http://svn.tools.ietf.org/svn/wg/httpbis/specs/rfc7233.html
It is functionally very similar to /stream-bytes, but it also
allows specifying a "Range" header, which allows the client
to ask for a specific portion of the resource.
I didn't add this functionality to /stream-bytes so as not
to break compatibility with any clients that expect range
requests to fail on that endpoint. Perhaps I'm just being
overly cautious.
It's useful for testing tools which track the progress of a request to know
the content length ahead of time.
Test included. I've verified that the new tests do fail without this change,
response.content_length is None if an explicit Content-Length isn't set.
If you do a "simple" request, there will be no CORS preflight
OPTIONS request. That means that Basic auth will fail over
CORS. This adds the header to all requests, fixing the problem.
Closes#122
The DELETE endpoint was missing form and files, so if you hit the
endpoint with data in the envelope and a Content-Type header set to
application/x-www-form-urlencoded, the data will disappear. Since RFC
2731 doesn't disallow content in the body of a DELETE request, let's
allow that data to pass through
Closes#143
I forgot to include the templates in setup.py, so httpbin would complain
and return a 500 when accessing views that require templates. This
fixes that problem by adding them as "data" in setup.py and MANIFEST.in