realgam3 / requests-raw

Use requests to send HTTP raw sockets (To Test RFC Compliance)
Apache License 2.0
20 stars 1 forks source link

Request with HEAD method not process #10

Open LTiDi2000 opened 1 week ago

LTiDi2000 commented 1 week ago

Greetings,

There is an issue while your lib not process the raw requests with HEAD as request method.

Working well with GET/POST/PUT/...:

raw_request = b"GET / HTTP/1.1\r\nHost: google.com\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\r\nAccept-Encoding: gzip,\
 deflate, br, zstd\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7\r\nConnection: keep-alive\r\nAccept-Language: e\
n-US,en;q=0.9\r\n\r\n"
image

Keep pending / no process / no connection with HEAD:

raw_request_head = b"HEAD / HTTP/1.1\r\nHost: google.com\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36\r\nAccept-Encoding:\
 gzip, deflate, br, zstd\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7\r\nConnection: keep-alive\r\nAccept-Langu\
age: en-US,en;q=0.9\r\n\r\n"
image

Please help check the issue and fix it!

Thanks and regards

realgam3 commented 1 week ago

Thank you for the example, I will check it out