Commit Graph

7 Commits

Author SHA1 Message Date
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