Commit Graph

145 Commits

Author SHA1 Message Date
Sergey Chizhik 936e49b4e9 sys > argparse, fix readme 2015-10-06 17:58:10 +03:00
Sergey Chizhik 53a286ee15 Add ability to specify port,host to run on 2015-10-04 10:58:14 +03:00
phouse512 2c51804e0b Added 406 unsupported media type response to /image 2015-09-17 08:36:47 -05:00
Erki Esken b1067077f5 Added SVG image serving support under /image and /image/svg 2015-09-09 16:06:36 +03:00
Ian Cordasco 7586d704a2 Merge pull request #246 from The-Compiler/tracking-scripts
Turn off tracking unless HTTPBIN_TRACKING is set.
2015-09-05 20:26:28 -05:00
Florian Bruhin 355e1f4fc7 Do env variable handling outside of template. 2015-08-31 21:55:44 +02:00
Florian Bruhin cca7119a60 Fix DELETE spelling in docstring. 2015-08-31 20:51:39 +02:00
Florian Bruhin 6858420e24 Turn off tracking unless HTTPBIN_TRACKING is set.
Fixes #245.
2015-08-31 20:49:12 +02:00
Tatsuhiro Tsujikawa 88a7e1966d Use url_for to resolve path instead of hard coding it
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.
2015-07-11 01:52:16 +09:00
Darrel 811d0d5177 Fixed /image when accept header not present #225 2015-06-01 11:10:33 -04:00
John Sheehan 261d786851 Merge pull request #202 from dshirley/master
Add range request functionality
2015-02-24 10:48:54 -08:00
David Shirley 0484ea2c91 Tidied the /range controller code
Extracted some of the range processing logic into a separate function
2015-01-26 14:54:36 -08:00
David Shirley 7e18da5ae9 Renamed endpoint /range-request -> /range 2015-01-26 13:51:47 -08:00
Ryan Park 0f4d3ff3d2 Initialize Bugsnag exception handler, when desired.
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`.
2015-01-16 13:20:48 -08:00
David Shirley 548e4df1f2 Remove trailing space from dictionary 2015-01-16 11:28:47 -08:00
David Shirley d7180a9df8 Tweaked the behavior of the 'duration' parameter of '/range-request'
This endpoint will now respond immediately with the first chunk of
data. It will then sleep right after sending each chunk.
2015-01-06 14:02:03 -08:00
David Shirley e73f34e335 Added a /range-request endpoint
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.
2015-01-02 13:22:42 -08:00
Marc Abramowitz be53651b3a Update /image and add /image/{jpeg,png,webp}
Fixes #183
2014-12-25 08:26:09 -08:00
Ian Cordasco 6b7676ba80 Merge pull request #161 from edgurgel/fix-redirect
Fix /redirect to return absolute URL
2014-12-23 19:56:38 -06:00
John Sheehan 8709122685 Merge pull request #190 from msabramo/utf8
Add /encoding/utf8 endpoint
2014-12-23 09:59:38 -08:00
Tatsuhiro Tsujikawa e1024d989c Add secure attribute to cookies if wsgi.url_scheme == 'https' 2014-12-23 19:08:48 +09:00
Eduardo Gurgel 54fc281ef7 Fix /redirect to return absolute URL 2014-12-23 19:31:44 +13:00
Marc Abramowitz 57c44f6748 Add /encoding/utf8 endpoint
Fixes #10
2014-12-22 19:23:16 -08:00
John Sheehan 5858e3d434 Merge branch 'GH-168' of https://github.com/msabramo/httpbin into msabramo-GH-168 2014-12-22 16:21:21 -08:00
John Sheehan 6930f8225d Merge pull request #160 from rictic/master
Send an explicit Content-Length header with /drip/
2014-12-22 16:19:10 -08:00
Marc Abramowitz 24dadf082c GH-168: Add newline to end of page
Fixes GH-168
2014-12-22 16:18:12 -08:00
John Sheehan 6dc5270b57 Merge pull request #158 from derflocki/wp-allow-headers
support Access-Control-Request-Headers
2014-12-22 16:15:05 -08:00
John Sheehan 8c11ed9883 Merge pull request #172 from msabramo/GH-125
GH-125: Support multiple headers with same key
2014-12-22 15:21:40 -08:00
Marc Abramowitz 941033ddd2 GH-125: Support multiple headers with same key
Fixes: GH-125
2014-11-29 06:19:30 -08:00
Marc Abramowitz ef9c3948e8 Imports; remove dup base64, alpha sort 2014-11-28 16:36:42 -08:00
Peter Burns 5021b420ef Send an explicit Content-Length header with /drip/
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.
2014-09-18 16:03:19 -07:00
derflocki 4554150ff9 got rid of unnecessary .get call 2014-09-11 20:24:10 +02:00
derflocki e68741e131 cleaned up 2014-09-10 08:20:51 +02:00
derflocki 43ced62b44 support Access-Control-Request-Headers 2014-09-09 21:26:25 +02:00
Ivan Júnior 24025f4a61 drip endpoint: adding custom status support 2014-08-08 18:10:01 -03:00
Kevin McCarthy 320e994c30 Add Access-Control-Allow-Credentials to All
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
2014-06-21 15:51:24 -10:00
Kevin McCarthy 5ee70566ec Fix Digest Auth to Return Correct Header
Digest Auth was returning the wrong header when a login attempt failed.

Closes #133
2014-06-21 13:58:36 -10:00
John Sheehan 64d10cba0e Add xml endpoint 2014-06-21 12:34:06 -10:00
Kevin McCarthy b2cb8678f3 Status Endpoint should Accept All HTTP Verbs
Closes #32 (again)
2014-06-21 12:16:00 -10:00
Kevin McCarthy 2593a8ab67 Add form and files to DELETE Endpoint
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
2014-06-21 11:53:44 -10:00
Kevin McCarthy 0c44ec9233 Restore random seed function for byte endpoints
os.urandom() ignores random.seed(), so I'm restoring the use of
random.randint in a python3 compatible way.
2014-06-08 22:09:25 -10:00
Kevin McCarthy 7e2214ce14 fix byte streaming endpoint in python3 2014-06-08 17:49:58 -10:00
Kevin McCarthy 16d6fea9b8 Fix bytes endpoint in python3 2014-06-08 17:49:58 -10:00
Kevin McCarthy a109bbbe29 Include Templates and Bump Version to 0.1.1
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
2014-06-01 12:08:32 -10:00
Matt Hickford 045f0f8843 Add endpoint /forms/post with simple HTML form that submits to /post 2014-05-29 23:11:25 +01:00
Kevin McCarthy 782a3411a7 Add Python3 Support
I mostly just added a bunch of encoding, especially around the HTTP
Digest Auth stuff.  This commit also adds six as a dependency.
2014-05-25 19:44:07 -10:00
Kenneth Reitz ee72c8547b no more deflate 2014-05-16 10:36:21 -04:00
Barun 6080ca1fc8 Add /deflate endpoint
returns response with deflate encoded body(Content-Encoding='deflate').
2014-03-19 21:07:11 +05:30
grun 07b0d1dce2 Add /drip, which drips data over a duration after an optional initial delay. 2014-02-28 01:48:27 -08:00
Ian Cordasco 4870f70c0d Send/require a cookie header on digest-auth
Also fix an import.
2013-07-19 15:48:44 -05:00