-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[bug] fetch
and XHR
response has no content-range
header
#11371
Comments
This is my
And this is the capability config:
|
This might be related to #10426. |
@chrox feel free to open a PR and @tweidinger will take a look from security prespective. |
Could you open an issue or better a PR if you have a fix? |
Sure. |
According to MDN on Access-Control-Expose-Headers, It sounds pretty safe to expose the |
Describe the bug
I don't know if it is intended or not but in both
asset
protocol and thehttp
protocol thecontent-range
header is discarded infetch
response. Without thecontent-range
header successive range requests cannot be performed such as in pdf.js.This is a normal
fetch
in macOS Safari browser:And this is a
fetch
in Tauri app in macOS:The static HTTP server
http://localhost:9000
is started withhttp-server -p 9000 -d . --cors
for testing purpose.And the
asset
protocol is also affected in Tauri app.Note that in the network inspector the
content-range
header is present but it's like being discarded somewhere in thefetch
response.I also try to figure out where the response headers are intercepted. At least the
wry
layer hold the intact headers:Let's set aside for now these two malformed headers
"65536": "content-length" and "application/pdf": "content-type"
that were introduced by recent code refactoring of wry; thewry
url_scheme_handler writes the correctcontent-range
header. I tried to addAccess-Control-Allow-Headers: *
orAccess-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Range
intauri/src/protocol/asset.ts
but it makes no difference on the response headers offetch
andXHR
. I have no clue on how the response headers are sent to the Javascript world. Could someone give a hint?Reproduction
No response
Expected behavior
No response
Full
tauri info
outputStack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: