Skip to content
New issue

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

Add "Content-Length" in HTTP header response? #799

Closed
ghost opened this issue Feb 6, 2013 · 2 comments
Closed

Add "Content-Length" in HTTP header response? #799

ghost opened this issue Feb 6, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 6, 2013

Maybe I missed something, it seams there is no Content-Length field in the response. I'd like to know if it's possible to do that. IMO it can be usefull when you deal with big json files, so you can calculate a % download progress,

Thanks!

@ghost
Copy link
Author

ghost commented Feb 7, 2013

Not sure if this is a good way to do that. Would be nice if someone can review this.

In ressource.py, I've added at the end of create_response(...)

...
response = response_class(content=serialized, content_type=build_content_type(desired_format), **response_kwargs)
response['Content-Length'] = len(serialized)
return response

@issackelly
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant