falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.53k stars 945 forks source link

feat(Response): Add viewable_as property #1958

Closed tipabu closed 3 years ago

tipabu commented 3 years ago

Summary of Changes

This is very similar to Response.downloadable_as, but uses an inline disposition type to display in-browser while still offering a suggested filename when saving.

Related Issues

Closes #1951

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

codecov[bot] commented 3 years ago

Codecov Report

Merging #1958 (eeab9e7) into master (d1a8bbb) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head eeab9e7 differs from pull request most recent head 828e910. Consider uploading reports for the commit 828e910 to get more accurate results Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1958   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6616      6618    +2     
  Branches      1067      1067           
=========================================
+ Hits          6616      6618    +2     
Impacted Files Coverage Δ
falcon/response.py 100.00% <100.00%> (ø)
falcon/response_helpers.py 100.00% <100.00%> (ø)

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 d1a8bbb...828e910. Read the comment docs.