From 1ef20e0010372f38b855cbf685f2cd6b529d0f49 Mon Sep 17 00:00:00 2001 From: Fernando Jimenez Date: Fri, 5 Jun 2015 12:53:58 +0200 Subject: [PATCH] Bug 1169613 - Use content type of synthesized response for JAR channel requests if available. Part 2: Set Content-Type for JAR Channel requests on Fetch API responses. r=nsm --- dom/fetch/FetchDriver.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index 4f2381da8852..a188fe1d6d8b 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -684,6 +684,13 @@ FetchDriver::OnStartRequest(nsIRequest* aRequest, uint32_t responseStatus = 200; nsAutoCString statusText; response = new InternalResponse(responseStatus, NS_LITERAL_CSTRING("OK")); + ErrorResult result; + nsAutoCString contentType; + jarChannel->GetContentType(contentType); + response->Headers()->Append(NS_LITERAL_CSTRING("content-type"), + contentType, + result); + MOZ_ASSERT(!result.Failed()); } // We open a pipe so that we can immediately set the pipe's read end as the