Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe495ce

Browse files
committed
Obey RFC2616
https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.htmlAn HTTP/1.1 proxy MUST ensure that any request message it forwards does contain an appropriate Host header field that identifies the service being requested by the proxy. All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field.
1 parent7c96730 commitfe495ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎pproxy/proto.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ async def connected(writer):
328328
writer.write(f'{method}{newpath}{ver}\r\n{lines}\r\n\r\n'.encode())
329329
returnTrue
330330
returnuser,host_name,port,connected
331-
asyncdefconnect(self,reader_remote,writer_remote,rauth,host_name,port,myhost,**kw):
332-
writer_remote.write(f'CONNECT{host_name}:{port} HTTP/1.1\r\nHost:{myhost}'.encode()+ (b'\r\nProxy-Authorization: Basic '+base64.b64encode(rauth)ifrauthelseb'')+b'\r\n\r\n')
331+
asyncdefconnect(self,reader_remote,writer_remote,rauth,host_name,port,**kw):
332+
writer_remote.write(f'CONNECT{host_name}:{port} HTTP/1.1\r\nHost:{host_name}:{port}'.encode()+ (b'\r\nProxy-Authorization: Basic '+base64.b64encode(rauth)ifrauthelseb'')+b'\r\n\r\n')
333333
awaitreader_remote.read_until(b'\r\n\r\n')
334334
asyncdefhttp_channel(self,reader,writer,stat_bytes,stat_conn):
335335
try:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp