Commit Graph

63 Commits

Author SHA1 Message Date
David Poole f0f3da7b52 add SHA-512 authentication 2017-11-19 08:42:09 -07:00
Marek Ruszczak 84edf61ad6 Split and strip qop. 2017-07-09 19:26:01 +02:00
Marek Ruszczak 477721960c Add test for wrong password and expired (reused) nonce value 2017-07-08 11:27:26 +02:00
Marek Ruszczak 7e8015237d Add test to verify „stale after” scenario 2017-07-08 10:59:21 +02:00
Marek Ruszczak 0c968cbd35 Refactor digest_auth test to be able add missing test cases in next commits 2017-07-06 23:24:44 +02:00
David D Lowe df3f0501a3 Add /anything route 2017-06-01 18:53:18 +01:00
mwarren 4706888b3d add POST to methods kwarg
and a test, for good measure
2017-05-26 07:34:46 -04:00
Mike Mattozzi 7061616db8 Adding an etag URL for testing If-Match and If-None-Match logic 2017-04-22 16:26:09 -04:00
Nate Prewitt b64036b316 fix Content-Length header value for /range endpoint 2017-03-30 10:32:11 -06:00
kennethreitz 47093ca934 no google analytics 2017-03-17 13:16:52 -04:00
kennethreitz 36c68180d0 Merge pull request #254 from Lukasa/brotli
Add a Brotli endpoint.
2017-03-16 20:21:26 -04:00
kennethreitz 341ddcc471 Merge pull request #312 from felixpalta/Runscope-GH-296-fix-drip-with-zero-numbytes
Fix error 500 on drip due to division by zero (issue #296)
2017-03-16 20:21:09 -04:00
kennethreitz 519196d5ab fix failing test 2017-03-16 19:56:09 -04:00
Cory Benfield dfed4ad635 Add basic do-almost-nothing Brotli endpoint test 2017-03-15 08:43:42 +00:00
kennethreitz 65e6a05d0b Merge pull request #319 from puiterwijk/fix-response
Use Response.data with older Werkzeug versions
2017-03-14 17:10:56 -04:00
Tuomas Lappeteläinen 94e64b4598 status/code: return 400 on invalid status code
Request such as `/status/4!9` caused a `ValueError` exception when
trying to cast the status to an int. Now the client is greeted with
`400` and a body of `Invalid status code`.

Fixes #329.
2017-02-19 16:00:59 +02:00
Patrick Uiterwijk 512fbbd610 Use Response.data with older Werkzeug versions
Response.get_data did not exist in older versions of Flask/Werkzeug,
and is even now not documented.
This will make httpbin work with either the new version where it does
exist, and the older versions where it doesn't.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2016-12-30 21:07:48 +00:00
Felix Palta bba7dd8ee4 Add test for drip with invalid numbytes parameter 2016-12-04 23:46:00 +03:00
Felix Palta 45058da872 Minor refactoring of _test_digest_auth
Instead of joining encoded (binary) strings, join unicode strings first, then encode result, which leads to shorter and clearer code.
2016-12-04 21:31:52 +03:00
Felix Palta 562a60bc23 Update comments, minor fixes 2016-12-04 00:41:02 +03:00
Felix Palta ec17414e94 Enable test cases for Digest auth requests with or without body
When quality-of-protection (qop) is 'auth-int', the hash of request body is used to create digest response.
2016-12-04 00:25:42 +03:00
Felix Palta 9816125df3 Add test for different combinations of digest auth parameters 2016-12-04 00:17:03 +03:00
Felix Palta ada6bd1508 Check response status code in test_digest_auth_with_wrong_password() 2016-12-03 23:34:00 +03:00
Felix Palta f198dab947 Add test implementation for Digest authentication
It can be used for testing of all available combinations of qop (auth/auth-int/not specified) and algorithms (MD5, SHA-256).
2016-12-03 23:31:08 +03:00
Ian Cordasco 6f5d34f730 Merge branch 'master' of https://github.com/Jaaap/httpbin into digest-auth-sha256
Conflicts:
    httpbin/templates/httpbin.1.html
2016-08-10 19:47:51 -05:00
tzickel aea465074e Added supports for non-get redirect-to with other status_code (#284) 2016-08-10 06:20:18 -05:00
teijsden 82e67ed210 Made the Digest algorithm code backwards compatible with old URL style, /digest-auth/auth/user/passwd now works again 2015-11-06 13:48:12 +01:00
teijsden 14b7f46c71 Added support for another Digest algorithm, SHA256. 2015-11-04 15:30:01 +01:00
Florian Bruhin 6858420e24 Turn off tracking unless HTTPBIN_TRACKING is set.
Fixes #245.
2015-08-31 20:49:12 +02:00
David Shirley 60b0ada6f1 Fixed unit tests for python3.4 2015-02-19 11:41:43 -08:00
David Shirley 7e18da5ae9 Renamed endpoint /range-request -> /range 2015-01-26 13:51:47 -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
Eduardo Gurgel 54fc281ef7 Fix /redirect to return absolute URL 2014-12-23 19:31:44 +13:00
John Sheehan b16206b80a Merge pull request #184 from msabramo/travis
Add .travis.yml for Travis CI
2014-12-22 16:51:40 -08:00
Marc Abramowitz 6ad0781991 Fix Travis py34 failure
by not relying on core.pyc file in test
2014-12-22 16:37:07 -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
Marc Abramowitz 941033ddd2 GH-125: Support multiple headers with same key
Fixes: GH-125
2014-11-29 06:19:30 -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 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 540b414490 Try to decode bytestrings from UTF8 in json_safe
Closes #148
2014-07-06 10:27:17 -10: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 f6d708ebe5 Check X-Forwarded-Proto when returning the url
Closes #31
2014-06-21 14:16:42 -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
Kevin McCarthy f3f136581a pep8 cleanup on tests 2014-06-21 12:48:00 -10:00
Kevin McCarthy 745f9b5009 Add test for XML endpoint 2014-06-21 12:34:22 -10:00
Kevin McCarthy b2cb8678f3 Status Endpoint should Accept All HTTP Verbs
Closes #32 (again)
2014-06-21 12:16:00 -10:00