mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-23 16:00:07 +00:00
83c063346d
Check the allowed characters for ":method" (see RFC 7230, section 3.2.6) and ":path". For ":path", the space and tab characters are now forbidden, but other special characters are still allowed for compatibility reasons. Update genvchartbl.py so that it generates the same table as in the code. Fixes #1611
24 lines
767 B
Python
Executable File
24 lines
767 B
Python
Executable File
#!/usr/bin/env python3
|
|
import sys
|
|
|
|
def name(i):
|
|
if i < 0x21:
|
|
return \
|
|
['NUL ', 'SOH ', 'STX ', 'ETX ', 'EOT ', 'ENQ ', 'ACK ', 'BEL ',
|
|
'BS ', 'HT ', 'LF ', 'VT ', 'FF ', 'CR ', 'SO ', 'SI ',
|
|
'DLE ', 'DC1 ', 'DC2 ', 'DC3 ', 'DC4 ', 'NAK ', 'SYN ', 'ETB ',
|
|
'CAN ', 'EM ', 'SUB ', 'ESC ', 'FS ', 'GS ', 'RS ', 'US ',
|
|
'SPC '][i]
|
|
elif i == 0x7f:
|
|
return 'DEL '
|
|
|
|
for i in range(256):
|
|
if (0x21 <= i and i < 0x7f):
|
|
sys.stdout.write('1 /* {} */, '.format(chr(i)))
|
|
elif 0x80 <= i:
|
|
sys.stdout.write('1 /* {} */, '.format(hex(i)))
|
|
else:
|
|
sys.stdout.write('0 /* {} */, '.format(name(i)))
|
|
if (i + 1)%4 == 0:
|
|
sys.stdout.write('\n')
|