mirror of https://github.com/scrapy/scrapy.git
Test Content-Encoding against Content-Disposition, URL and body
This commit is contained in:
parent
ff37b274a6
commit
86baef02a0
|
|
@ -500,6 +500,43 @@ POST_XTRACTMIME_SCENARIOS = (
|
|||
)
|
||||
),
|
||||
|
||||
# Compressed content should be of type Response until uncompressed.
|
||||
(
|
||||
{
|
||||
'headers': Headers(
|
||||
{
|
||||
'Content-Disposition': [
|
||||
'attachment; filename="a.html"',
|
||||
],
|
||||
'Content-Encoding': ['zip'],
|
||||
}
|
||||
)
|
||||
},
|
||||
Response,
|
||||
),
|
||||
(
|
||||
{
|
||||
"url": "file:///a.html",
|
||||
'headers': Headers(
|
||||
{
|
||||
'Content-Encoding': ['zip'],
|
||||
}
|
||||
)
|
||||
},
|
||||
Response,
|
||||
),
|
||||
(
|
||||
{
|
||||
"body": b"<html>",
|
||||
'headers': Headers(
|
||||
{
|
||||
'Content-Encoding': ['zip'],
|
||||
}
|
||||
)
|
||||
},
|
||||
Response,
|
||||
),
|
||||
|
||||
# If the body is empty, it contains no binary data bytes, hence body-based
|
||||
# MIME type detection must interpret the result as text.
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue