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

Overwrite FileResponse Content-Type with application/octet-stream for all files in /store #1064

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AliveDevil
Copy link

Fixes #1059

@AliveDevil
Copy link
Author

Should these be squashed? @aparcar

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.47%. Comparing base (5e65dec) to head (122d701).
Report is 141 commits behind head on main.

Files with missing lines Patch % Lines
asu/fastapi/StaticFiles.py 69.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1064      +/-   ##
==========================================
+ Coverage   80.75%   90.47%   +9.71%     
==========================================
  Files          15       15              
  Lines         977     1123     +146     
==========================================
+ Hits          789     1016     +227     
+ Misses        188      107      -81     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

from asu.config import settings
from asu.fastapi.staticfiles import FileResponse

store_path = settings.public_path / "store"
Copy link
Author

Choose a reason for hiding this comment

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

This is ugly.

But conftest.py overwrites settings.public_path, unfortunately the main.py/app has already been constructed, with the previous old public_path.
Thus the conftest.py app()-setting of public_path to a temp-path doesn't work here.

@aparcar
Copy link
Member

aparcar commented Dec 3, 2024

Could you please try again and see if the issue is resolved? If so the Caddy docs are broken, caddy is broken or I misunderstand some stuff, however it worked on my test run with Firefox

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.

Incorrect Content-Type results in firmware files opening in the browser
2 participants