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

RESOLVED FIXED in Firefox 41

Status

()

defect
RESOLVED FIXED
4 years ago
4 months 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)

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: nobody → ferjmoreno
Whiteboard: [s3]
Posted patch v1 (obsolete) — Splinter Review
Working on tests now
Attachment #8613457 - Flags: review?(josh)
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+
r=jdm from comment 2
Attachment #8613457 - Attachment is obsolete: true
Attachment #8613952 - Flags: review+
Posted patch Part 3: TestsSplinter Review
Attachment #8613954 - Flags: review?(josh)
Target Milestone: --- → NGA S2 (12Jun)
Attachment #8613954 - Flags: review?(josh) → review+
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.