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

Set default content-type html for actix feature #160

Merged
merged 1 commit into from
Dec 15, 2018

Conversation

infogulch
Copy link
Contributor

Whenever I used @for of any kind in the returned Markup, Actix detected the content type as application/octet-stream, which prevented the browser from displaying it as html.

This PR explicitly sets content-type to "text/html" in the Actix feature handler, and fixes the above issue. I don't see any reason why this would be incorrect, because all Markup instances are html. One adjustment might be to explicitly set encoding to utf-8. Let me know if you'd prefer that.

@lambda-fairy
Copy link
Owner

lambda-fairy commented Nov 4, 2018

Sounds good to me!

Yeah, I think explicitly setting the encoding to UTF-8 makes sense. It's what Rocket does as well.

@Leward
Copy link

Leward commented Dec 13, 2018

Hello, is any update on the PR? Is there anything I can do to help?

@lambda-fairy
Copy link
Owner

lambda-fairy commented Dec 14, 2018

@Leward As noted above, we should set the encoding to UTF-8 as well.

If you want to make a separate pull request with that change then I'll be happy to merge it.

@infogulch
Copy link
Contributor Author

Hi! Sorry it took me so long to get to this. The code is now updated to include the encoding.

@lambda-fairy lambda-fairy merged commit 892aaac into lambda-fairy:master Dec 15, 2018
@lambda-fairy
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants