Use content type of synthesized response for JAR channel requests if available

RESOLVED FIXED in Firefox 41

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ferjm, Assigned: ferjm)

Tracking

unspecified
NGA S2 (12Jun)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox41 fixed)

Details

(Whiteboard: [s3])

Attachments

(3 attachments, 1 obsolete attachment)

(Assignee)

Description

3 years ago
We are currently inferring the content type from the URL of the request, but that should not necessarily be the same as the on specified in the synthesized response.
(Assignee)

Updated

3 years ago
Assignee: nobody → ferjmoreno
Blocks: 1153312
Whiteboard: [s3]

Updated

3 years ago
Blocks: 1131322
(Assignee)

Comment 1

3 years ago
Created attachment 8613457 [details] [diff] [review]
v1

Working on tests now
Attachment #8613457 - Flags: review?(josh)

Comment 2

3 years ago
Comment on attachment 8613457 [details] [diff] [review]
v1

Review of attachment 8613457 [details] [diff] [review]:
-----------------------------------------------------------------

This should have a test, too. I think we can perform an XHR to an ".txt" app url that is intercepted and set the responseType to "document", then sythesize a text/html response and check that xhr.response is a Document object once the request is complete.

::: modules/libjar/nsJARChannel.cpp
@@ +896,5 @@
>  }
>  
>  void
> +nsJARChannel::OverrideWithSynthesizedResponse(nsIInputStream* aSynthesizedInput,
> +                                              nsCString aContentType)

const nsACString&

@@ +917,5 @@
>        aSynthesizedInput->Close();
>        return;
>      }
>  
> +    mContentType = aContentType;

Call SetContentType instead.
Attachment #8613457 - Flags: review?(josh) → review+
(Assignee)

Comment 3

3 years ago
Created attachment 8613952 [details] [diff] [review]
Part 1: Set Content-Type on synthesized response

r=jdm from comment 2
Attachment #8613457 - Attachment is obsolete: true
Attachment #8613952 - Flags: review+
(Assignee)

Comment 4

3 years ago
Created attachment 8613953 [details] [diff] [review]
Part 2: Set Content-Type on Fetch API response
Attachment #8613953 - Flags: review?(nsm.nikhil)
(Assignee)

Comment 5

3 years ago
Created attachment 8613954 [details] [diff] [review]
Part 3: Tests
Attachment #8613954 - Flags: review?(josh)

Updated

3 years ago
Target Milestone: --- → NGA S2 (12Jun)

Updated

3 years ago
Attachment #8613954 - Flags: review?(josh) → review+

Updated

3 years ago
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/bf8a4b45e3da
https://hg.mozilla.org/mozilla-central/rev/99fc1ca23701
https://hg.mozilla.org/mozilla-central/rev/52256ba02d2e
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox41: --- → fixed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.