We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curl -v localhost:8000 >GET / HTTP/1.1 >Host: localhost:8000 >User-Agent: curl/7.52.1 >Accept: */*
curl -v localhost:8000
>GET / HTTP/1.1
>Host: localhost:8000
>User-Agent: curl/7.52.1
>Accept: */*
HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.3 Python/2.7.12 < Date: Thu, 27 Apr 2017 20:30:54 GMT < Content-Length: 83 < Content-Type: application/xml < Content-Type: application/xml < Curl_http_done: called premature == 0 Closing connection 0 <?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello World</Say>
HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: BaseHTTP/0.3 Python/2.7.12
< Date: Thu, 27 Apr 2017 20:30:54 GMT
< Content-Length: 83
< Content-Type: application/xml
<
Curl_http_done: called premature == 0
Closing connection 0
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello World</Say>
The text was updated successfully, but these errors were encountered:
Confirmed bug, thanks for reporting.
from chalice import Chalice, Response app = Chalice(app_name='headerfix') @app.route('/', content_types=['application/json']) def index(): return Response(body='{"foo": "bar"}', status_code=200, headers={'Content-Type': 'application/json'})
$ chalice local & $ curl -vv localhost:8000 * Rebuilt URL to: localhost:8000/ * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8000 (#0) > GET / HTTP/1.1 > Host: localhost:8000 > User-Agent: curl/7.43.0 > Accept: */* > 127.0.0.1 - - [27/Apr/2017 17:09:26] "GET / HTTP/1.1" 200 - * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Server: BaseHTTP/0.3 Python/2.7.12 < Date: Fri, 28 Apr 2017 00:09:26 GMT < Content-Length: 14 < Content-Type: application/json < Content-Type: application/json < * Closing connection 0
Sorry, something went wrong.
Don't duplicate content type header in local mode
173457d
Fixes aws#310
No branches or pull requests
curl -v localhost:8000
>GET / HTTP/1.1
>Host: localhost:8000
>User-Agent: curl/7.52.1
>Accept: */*
HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: BaseHTTP/0.3 Python/2.7.12
< Date: Thu, 27 Apr 2017 20:30:54 GMT
< Content-Length: 83
< Content-Type: application/xml
< Content-Type: application/xml
<
Curl_http_done: called premature == 0
Closing connection 0
<?xml version="1.0" encoding="UTF-8"?><Response><Say>Hello World</Say>
The text was updated successfully, but these errors were encountered: