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
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
32c842f06f
Fix bug that was causing POSTs missing a content-type header to 500
...
Closes #141
2014-06-05 18:00:52 -10: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
Rodrigo Chacon
e3cd47d0e2
Use header Origin in response headers when available
...
Since the RFC [1] doesn't allow wildcards for credentialed requests,
add the requested Origin into the response headers.
[1] https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS#Requests_with_credentials
2013-04-24 19:33:18 -03:00
Rodrigo Chacon
50ddd78b89
PEP8
2013-04-24 19:33:18 -03:00
Rodrigo Chacon
11a8c78aa5
Adding support for preflight request headers
...
Just as stated in http://www.w3.org/TR/cors/#preflight-request , we must return some extra headers when dealing with preflight (HTTP OPTIONS method) requests.
2013-04-24 19:33:18 -03:00
Rodrigo Chacon
61bed33f24
Adding CORS support for all requests
2013-04-24 19:33:18 -03:00
Radomir Stevanovic
9a56bb8dd0
bugfix: JSON-safe encoding of raw binary data/files
...
Encoding of the received files and/or body data was failing in case of raw
binary data being POSTed/PUT/etc. (The exact trigger was actually a non-UTF-8
data stream, since Flask's `jsonify`, i.e. `simplejson.dumps` assumes UTF-8.)
Binary data in a JSON response are now encoded as "data" URLs, according to
RFC 2397. "Data" URL scheme was chosen for its simplicity and clarity. MIME
type is included. Plain text is passed thru unmodified, as before.
Also, tests demonstrating the bug/fix added to `test_httpbin.py`.
2012-08-14 22:57:35 +02:00
Radomir Stevanovic
213d03a090
init fixes (git, pip & test related)
...
- gitignored: *.pyc, env/
- gevent added to requirements.txt
- test_httpbin syntax error fix
2012-08-14 20:43:35 +02:00
Ori Livneh
52871e8301
base64-decoding endpoint + test
2011-12-20 00:26:14 -05:00