['GET /file/32%E4%BD%8D_______IE11.EXE HTTP/1.1', 。。。。。
谁能告诉我为毛浏览器的GET请求是%E4%BD%8D是utf-8的编码
我明明已经解码了可还是 utf-8的码发过来?
下面是原代码:
# 接收浏览器的请求头
data = new_socket.recv(1048).decode("utf-8")
request = data.splitlines()
print("\n","="*50)
print(str(request))
ret = re.match(r"[^/]+(/[^ ]*)", request[0])
if ret:
[][][][]file_name = ret.group(1)
[][][][] # TODO /file/32%E4%BD%8D_______IE11.EXE 解码<<<<<<<<<<<<<看这里<<<
[][][][] print(ret.group(1))<<<<<<<<<取出来的是/file/32%E4%BD%8D_______IE11.EXE
if file_name == "/":
[][][][] # 如果只有一个斜线
[][][][]# HOME_PATH全局变量
[][][][] file_name = HOME_PATH
谁能告诉我为毛浏览器的GET请求是%E4%BD%8D是utf-8的编码
我明明已经解码了可还是 utf-8的码发过来?
下面是原代码:
# 接收浏览器的请求头
data = new_socket.recv(1048).decode("utf-8")
request = data.splitlines()
print("\n","="*50)
print(str(request))
ret = re.match(r"[^/]+(/[^ ]*)", request[0])
if ret:
[][][][]file_name = ret.group(1)
[][][][] # TODO /file/32%E4%BD%8D_______IE11.EXE 解码<<<<<<<<<<<<<看这里<<<
[][][][] print(ret.group(1))<<<<<<<<<取出来的是/file/32%E4%BD%8D_______IE11.EXE
if file_name == "/":
[][][][] # 如果只有一个斜线
[][][][]# HOME_PATH全局变量
[][][][] file_name = HOME_PATH