@@ -317,7 +317,7 @@ def _req(
317317
318318 def test_handle_missing_content_type (self ) -> None :
319319 channel = self ._req (
320- b"inline ; filename=out" + self .test_image .extension ,
320+ b"attachment ; filename=out" + self .test_image .extension ,
321321 include_content_type = False ,
322322 )
323323 headers = channel .headers
@@ -331,15 +331,15 @@ def test_disposition_filename_ascii(self) -> None:
331331 If the filename is filename=<ascii> then Synapse will decode it as an
332332 ASCII string, and use filename= in the response.
333333 """
334- channel = self ._req (b"inline ; filename=out" + self .test_image .extension )
334+ channel = self ._req (b"attachment ; filename=out" + self .test_image .extension )
335335
336336 headers = channel .headers
337337 self .assertEqual (
338338 headers .getRawHeaders (b"Content-Type" ), [self .test_image .content_type ]
339339 )
340340 self .assertEqual (
341341 headers .getRawHeaders (b"Content-Disposition" ),
342- [b"inline ; filename=out" + self .test_image .extension ],
342+ [b"attachment ; filename=out" + self .test_image .extension ],
343343 )
344344
345345 def test_disposition_filenamestar_utf8escaped (self ) -> None :
@@ -350,7 +350,7 @@ def test_disposition_filenamestar_utf8escaped(self) -> None:
350350 """
351351 filename = parse .quote ("\u2603 " .encode ()).encode ("ascii" )
352352 channel = self ._req (
353- b"inline ; filename*=utf-8''" + filename + self .test_image .extension
353+ b"attachment ; filename*=utf-8''" + filename + self .test_image .extension
354354 )
355355
356356 headers = channel .headers
@@ -359,21 +359,21 @@ def test_disposition_filenamestar_utf8escaped(self) -> None:
359359 )
360360 self .assertEqual (
361361 headers .getRawHeaders (b"Content-Disposition" ),
362- [b"inline ; filename*=utf-8''" + filename + self .test_image .extension ],
362+ [b"attachment ; filename*=utf-8''" + filename + self .test_image .extension ],
363363 )
364364
365365 def test_disposition_none (self ) -> None :
366366 """
367- If there is no filename, one isn't passed on in the Content-Disposition
368- of the request .
367+ If there is no filename, Content-Disposition should only
368+ be a disposition type .
369369 """
370370 channel = self ._req (None )
371371
372372 headers = channel .headers
373373 self .assertEqual (
374374 headers .getRawHeaders (b"Content-Type" ), [self .test_image .content_type ]
375375 )
376- self .assertEqual (headers .getRawHeaders (b"Content-Disposition" ), None )
376+ self .assertEqual (headers .getRawHeaders (b"Content-Disposition" ), [ b"attachment" ] )
377377
378378 def test_thumbnail_crop (self ) -> None :
379379 """Test that a cropped remote thumbnail is available."""
@@ -612,7 +612,7 @@ def test_x_robots_tag_header(self) -> None:
612612 Tests that the `X-Robots-Tag` header is present, which informs web crawlers
613613 to not index, archive, or follow links in media.
614614 """
615- channel = self ._req (b"inline ; filename=out" + self .test_image .extension )
615+ channel = self ._req (b"attachment ; filename=out" + self .test_image .extension )
616616
617617 headers = channel .headers
618618 self .assertEqual (
@@ -625,7 +625,7 @@ def test_cross_origin_resource_policy_header(self) -> None:
625625 Test that the Cross-Origin-Resource-Policy header is set to "cross-origin"
626626 allowing web clients to embed media from the downloads API.
627627 """
628- channel = self ._req (b"inline ; filename=out" + self .test_image .extension )
628+ channel = self ._req (b"attachment ; filename=out" + self .test_image .extension )
629629
630630 headers = channel .headers
631631
0 commit comments