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-Disposition to NamedFile (fixes #172) #204

Merged
merged 2 commits into from
Apr 29, 2018
Merged

Add Content-Disposition to NamedFile (fixes #172) #204

merged 2 commits into from
Apr 29, 2018

Conversation

svenstaro
Copy link
Contributor

I used the raw strings for the headers instead of stuff in content_disposition.rs because that is commented out and I don't know why that is.

@DoumanAsh
Copy link
Contributor

Hej @svenstaro in past we had some talk about this header with @fafhrd91
Sadly I was a bit busy to work on it myself, but we had idea about simple heuristic to deterine whether file should be inline or attachment.
Things like images should more like to be as inline rather than attachment.

And more importantly it would be nice to have a way for user to configure it in place of automatic settings my actix-web itself.

@svenstaro
Copy link
Contributor Author

Alright fair enough but for now this would be an improvement over the current state for sure.

@fafhrd91
Copy link
Member

@svenstaro could you use inline for images and text

you can check mimetype by get_mime_type(&ext.to_string_lossy(())

@fafhrd91 fafhrd91 self-requested a review April 27, 2018 18:56
Copy link
Member

@fafhrd91 fafhrd91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use inline for images and text. you can check mimetype by get_mime_type(&ext.to_string_lossy(())

@codecov
Copy link

codecov bot commented Apr 29, 2018

Codecov Report

Merging #204 into master will decrease coverage by 0.4%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
- Coverage   78.68%   78.27%   -0.41%     
==========================================
  Files          91       90       -1     
  Lines       11164    11328     +164     
==========================================
+ Hits         8784     8867      +83     
- Misses       2380     2461      +81
Impacted Files Coverage Δ
src/fs.rs 89.35% <100%> (-0.23%) ⬇️
tests/test_handlers.rs 87.83% <0%> (-12.17%) ⬇️
src/server/helpers.rs 85.33% <0%> (-6.1%) ⬇️
tests/test_client.rs 89.88% <0%> (-4.57%) ⬇️
src/server/h1.rs 82.17% <0%> (-4.01%) ⬇️
src/json.rs 84.21% <0%> (-3.71%) ⬇️
src/header/shared/entity.rs 85.43% <0%> (-3.68%) ⬇️
src/middleware/defaultheaders.rs 75% <0%> (-2.78%) ⬇️
src/de.rs 49.36% <0%> (-2.45%) ⬇️
tests/test_server.rs 96.16% <0%> (-1.89%) ⬇️
... and 55 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de49796...de222fe. Read the comment docs.

@svenstaro
Copy link
Contributor Author

@fafhrd91 fixed with tests.

@fafhrd91
Copy link
Member

thanks

@fafhrd91 fafhrd91 merged commit eb6e618 into actix:master Apr 29, 2018
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