mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(webkit): deduce response mime type from content-type (#9264)
This commit is contained in:
parent
235eaca34a
commit
1b4adfb916
@ -130,7 +130,7 @@ export class WKRouteImpl implements network.RouteDelegate {
|
|||||||
// In certain cases, protocol will return error if the request was already canceled
|
// In certain cases, protocol will return error if the request was already canceled
|
||||||
// or the page was closed. We should tolerate these errors.
|
// or the page was closed. We should tolerate these errors.
|
||||||
let mimeType = response.isBase64 ? 'application/octet-stream' : 'text/plain';
|
let mimeType = response.isBase64 ? 'application/octet-stream' : 'text/plain';
|
||||||
const headers = headersArrayToObject(response.headers, false /* lowerCase */);
|
const headers = headersArrayToObject(response.headers, true /* lowerCase */);
|
||||||
const contentType = headers['content-type'];
|
const contentType = headers['content-type'];
|
||||||
if (contentType)
|
if (contentType)
|
||||||
mimeType = contentType.split(';')[0].trim();
|
mimeType = contentType.split(';')[0].trim();
|
||||||
|
|||||||
@ -225,7 +225,7 @@ it('should fulfill with fetch result and overrides', async ({ page, server, isEl
|
|||||||
response,
|
response,
|
||||||
status: 201,
|
status: 201,
|
||||||
headers: {
|
headers: {
|
||||||
...response.headers(),
|
'Content-Type': 'application/json', // Case matters for the tested behavior
|
||||||
'foo': 'bar'
|
'foo': 'bar'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user