@@ -19,7 +19,7 @@ public function test_book_html_endpoint()
1919 $ resp = $ this ->get ("/api/books/ {$ book ->id }/export/html " );
2020 $ resp ->assertStatus (200 );
2121 $ resp ->assertSee ($ book ->name );
22- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ book ->slug . '.html" ' );
22+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ book ->slug . '.html ' );
2323 }
2424
2525 public function test_book_plain_text_endpoint ()
@@ -30,7 +30,7 @@ public function test_book_plain_text_endpoint()
3030 $ resp = $ this ->get ("/api/books/ {$ book ->id }/export/plaintext " );
3131 $ resp ->assertStatus (200 );
3232 $ resp ->assertSee ($ book ->name );
33- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ book ->slug . '.txt" ' );
33+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ book ->slug . '.txt ' );
3434 }
3535
3636 public function test_book_pdf_endpoint ()
@@ -40,7 +40,7 @@ public function test_book_pdf_endpoint()
4040
4141 $ resp = $ this ->get ("/api/books/ {$ book ->id }/export/pdf " );
4242 $ resp ->assertStatus (200 );
43- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ book ->slug . '.pdf" ' );
43+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ book ->slug . '.pdf ' );
4444 }
4545
4646 public function test_book_markdown_endpoint ()
@@ -50,7 +50,7 @@ public function test_book_markdown_endpoint()
5050
5151 $ resp = $ this ->get ("/api/books/ {$ book ->id }/export/markdown " );
5252 $ resp ->assertStatus (200 );
53- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ book ->slug . '.md" ' );
53+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ book ->slug . '.md ' );
5454 $ resp ->assertSee ('# ' . $ book ->name );
5555 $ resp ->assertSee ('# ' . $ book ->pages ()->first ()->name );
5656 $ resp ->assertSee ('# ' . $ book ->chapters ()->first ()->name );
@@ -63,7 +63,7 @@ public function test_book_zip_endpoint()
6363
6464 $ resp = $ this ->get ("/api/books/ {$ book ->id }/export/zip " );
6565 $ resp ->assertStatus (200 );
66- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ book ->slug . '.zip" ' );
66+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ book ->slug . '.zip ' );
6767
6868 $ zip = ZipTestHelper::extractFromZipResponse ($ resp );
6969 $ this ->assertArrayHasKey ('book ' , $ zip ->data );
@@ -77,7 +77,7 @@ public function test_chapter_html_endpoint()
7777 $ resp = $ this ->get ("/api/chapters/ {$ chapter ->id }/export/html " );
7878 $ resp ->assertStatus (200 );
7979 $ resp ->assertSee ($ chapter ->name );
80- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ chapter ->slug . '.html" ' );
80+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ chapter ->slug . '.html ' );
8181 }
8282
8383 public function test_chapter_plain_text_endpoint ()
@@ -88,7 +88,7 @@ public function test_chapter_plain_text_endpoint()
8888 $ resp = $ this ->get ("/api/chapters/ {$ chapter ->id }/export/plaintext " );
8989 $ resp ->assertStatus (200 );
9090 $ resp ->assertSee ($ chapter ->name );
91- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ chapter ->slug . '.txt" ' );
91+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ chapter ->slug . '.txt ' );
9292 }
9393
9494 public function test_chapter_pdf_endpoint ()
@@ -98,7 +98,7 @@ public function test_chapter_pdf_endpoint()
9898
9999 $ resp = $ this ->get ("/api/chapters/ {$ chapter ->id }/export/pdf " );
100100 $ resp ->assertStatus (200 );
101- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ chapter ->slug . '.pdf" ' );
101+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ chapter ->slug . '.pdf ' );
102102 }
103103
104104 public function test_chapter_markdown_endpoint ()
@@ -108,7 +108,7 @@ public function test_chapter_markdown_endpoint()
108108
109109 $ resp = $ this ->get ("/api/chapters/ {$ chapter ->id }/export/markdown " );
110110 $ resp ->assertStatus (200 );
111- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ chapter ->slug . '.md" ' );
111+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ chapter ->slug . '.md ' );
112112 $ resp ->assertSee ('# ' . $ chapter ->name );
113113 $ resp ->assertSee ('# ' . $ chapter ->pages ()->first ()->name );
114114 }
@@ -120,7 +120,7 @@ public function test_chapter_zip_endpoint()
120120
121121 $ resp = $ this ->get ("/api/chapters/ {$ chapter ->id }/export/zip " );
122122 $ resp ->assertStatus (200 );
123- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ chapter ->slug . '.zip" ' );
123+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ chapter ->slug . '.zip ' );
124124
125125 $ zip = ZipTestHelper::extractFromZipResponse ($ resp );
126126 $ this ->assertArrayHasKey ('chapter ' , $ zip ->data );
@@ -134,7 +134,7 @@ public function test_page_html_endpoint()
134134 $ resp = $ this ->get ("/api/pages/ {$ page ->id }/export/html " );
135135 $ resp ->assertStatus (200 );
136136 $ resp ->assertSee ($ page ->name );
137- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ page ->slug . '.html" ' );
137+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ page ->slug . '.html ' );
138138 }
139139
140140 public function test_page_plain_text_endpoint ()
@@ -145,7 +145,7 @@ public function test_page_plain_text_endpoint()
145145 $ resp = $ this ->get ("/api/pages/ {$ page ->id }/export/plaintext " );
146146 $ resp ->assertStatus (200 );
147147 $ resp ->assertSee ($ page ->name );
148- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ page ->slug . '.txt" ' );
148+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ page ->slug . '.txt ' );
149149 }
150150
151151 public function test_page_pdf_endpoint ()
@@ -155,7 +155,7 @@ public function test_page_pdf_endpoint()
155155
156156 $ resp = $ this ->get ("/api/pages/ {$ page ->id }/export/pdf " );
157157 $ resp ->assertStatus (200 );
158- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ page ->slug . '.pdf" ' );
158+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ page ->slug . '.pdf ' );
159159 }
160160
161161 public function test_page_markdown_endpoint ()
@@ -166,7 +166,7 @@ public function test_page_markdown_endpoint()
166166 $ resp = $ this ->get ("/api/pages/ {$ page ->id }/export/markdown " );
167167 $ resp ->assertStatus (200 );
168168 $ resp ->assertSee ('# ' . $ page ->name );
169- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ page ->slug . '.md" ' );
169+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ page ->slug . '.md ' );
170170 }
171171
172172 public function test_page_zip_endpoint ()
@@ -176,7 +176,7 @@ public function test_page_zip_endpoint()
176176
177177 $ resp = $ this ->get ("/api/pages/ {$ page ->id }/export/zip " );
178178 $ resp ->assertStatus (200 );
179- $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename=" ' . $ page ->slug . '.zip" ' );
179+ $ resp ->assertHeader ('Content-Disposition ' , 'attachment; filename*=UTF-8 \'\'' . $ page ->slug . '.zip ' );
180180
181181 $ zip = ZipTestHelper::extractFromZipResponse ($ resp );
182182 $ this ->assertArrayHasKey ('page ' , $ zip ->data );
0 commit comments