@@ -28,14 +28,14 @@ const httpServer = http.createServer(common.mustNotCall());
28
28
29
29
httpServer . once ( 'clientError' , common . mustCall ( ( err , socket ) => {
30
30
assert . strictEqual ( err . code , 'HPE_INVALID_METHOD' ) ;
31
- assert . strictEqual ( err . rawPacket . toString ( ) , 'Q ' ) ;
31
+ assert . strictEqual ( err . rawPacket . toString ( ) , '1 ' ) ;
32
32
socket . destroy ( ) ;
33
33
34
34
httpServer . once ( 'clientError' , common . mustCall ( ( err ) => {
35
35
assert . strictEqual ( err . code , 'HPE_INVALID_METHOD' ) ;
36
36
assert . strictEqual (
37
37
err . rawPacket . toString ( ) ,
38
- 'WE http://example.com HTTP/1.1\r\n\r\n'
38
+ '23 http://example.com HTTP/1.1\r\n\r\n'
39
39
) ;
40
40
} ) ) ;
41
41
} ) ) ;
@@ -44,7 +44,11 @@ netServer.listen(0, common.mustCall(() => {
44
44
const socket = net . createConnection ( netServer . address ( ) . port ) ;
45
45
46
46
socket . on ( 'connect' , common . mustCall ( ( ) => {
47
- socket . end ( 'QWE http://example.com HTTP/1.1\r\n\r\n' ) ;
47
+ // Note: do not use letters here for the method.
48
+ // There is a very small chance that a method with that initial
49
+ // might be added in the future and thus this test might fail.
50
+ // Numbers will likely never have this issue.
51
+ socket . end ( '123 http://example.com HTTP/1.1\r\n\r\n' ) ;
48
52
} ) ) ;
49
53
50
54
socket . on ( 'close' , ( ) => {
0 commit comments