Commit 38ecde8 1 parent a311181 commit 38ecde8 Copy full SHA for 38ecde8
File tree 6 files changed +46
-0
lines changed
6 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ async_test ( t => {
2
+ const script = document . createElement ( "script" ) ;
3
+ t . add_cleanup ( ( ) => script . remove ( ) ) ;
4
+ script . src = "resources/script-with-0x00-in-header.py" ;
5
+ script . onerror = t . step_func_done ( ) ;
6
+ script . onload = t . unreached_func ( ) ;
7
+ document . body . append ( script ) ;
8
+ } , "Expect network error for script with 0x00 in a header" ) ;
9
+
10
+ async_test ( t => {
11
+ const frame = document . createElement ( "iframe" ) ;
12
+ t . add_cleanup ( ( ) => frame . remove ( ) ) ;
13
+ frame . src = "resources/document-with-0x00-in-header.py" ;
14
+ // If network errors result in load events for frames per
15
+ // https://github.com/whatwg/html/issues/125 and https://github.com/whatwg/html/issues/1230 this
16
+ // should be changed to use the load event instead.
17
+ t . step_timeout ( ( ) => {
18
+ assert_equals ( frame . contentDocument , null ) ;
19
+ t . done ( ) ;
20
+ } , 1000 ) ;
21
+ document . body . append ( frame ) ;
22
+ } , "Expect network error for frame navigation to resource with 0x00 in a header" ) ;
23
+
24
+ async_test ( t => {
25
+ const img = document . createElement ( "img" ) ;
26
+ t . add_cleanup ( ( ) => img . remove ( ) ) ;
27
+ img . src = "resources/blue-with-0x00-in-a-header.asis" ;
28
+ img . onerror = t . step_func_done ( ) ;
29
+ img . onload = t . unreached_func ( ) ;
30
+ document . body . append ( img ) ;
31
+ } , "Expect network error for image with 0x00 in a header" ) ;
Original file line number Diff line number Diff line change
1
+ ` blue-with-0x00-in-a-header.asis ` is a copy from ` ../../images/blue.png ` with the following prepended using Control Pictures to signify actual newlines and 0x00:
2
+ ```
3
+ HTTP/1.1 200 AN IMAGE␍␊
4
+ Content-Type: image/png␍␊
5
+ Custom: ␀␍␊␍␊
6
+ ```
Original file line number Diff line number Diff line change
1
+ def main (request , response ):
2
+ response .headers .set ("Content-Type" , "text/html" )
3
+ response .headers .set ("Custom" , "\0 " )
4
+ return "<!doctype html><b>This is a document.</b>"
Original file line number Diff line number Diff line change
1
+ def main (request , response ):
2
+ response .headers .set ("Content-Type" , "text/javascript" )
3
+ response .headers .set ("Custom" , "\0 " )
4
+ return "var thisIsJavaScript = 0"
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ AHEM COPY: css/vendor-imports/mozilla/mozilla-central-reftests/*/Ahem.ttf
77
77
# Intentional use of CRLF
78
78
CR AT EOL: WebIDL/valid/idl/documentation-dos.widl
79
79
CR AT EOL: cors/resources/cors-headers.asis
80
+ CR AT EOL: fetch/h1-parsing/resources/blue-with-0x00-in-a-header.asis
80
81
CR AT EOL: html/semantics/forms/the-textarea-element/multiline-placeholder-cr.html
81
82
CR AT EOL: html/semantics/forms/the-textarea-element/multiline-placeholder-crlf.html
82
83
CR AT EOL: html/semantics/forms/the-input-element/multiline-placeholder-cr.html
You can’t perform that action at this time.
0 commit comments