Folder removed

This commit is contained in:
Jan Stárek
2019-11-20 18:49:01 +01:00
parent 4ea29e2464
commit 955bddda2f
54 changed files with 163 additions and 163 deletions

21
fuzzer/fake_socket.py Normal file
View File

@@ -0,0 +1,21 @@
from http.client import HTTPResponse, HTTPException
from typing import Union
from io import BytesIO
class FakeSocket:
def __init__(self, response_str):
self._file = BytesIO(response_str)
def makefile(self, *args, **kwargs):
return self._file
def get_response_object(data) -> Union[HTTPResponse, None]:
try:
source = FakeSocket(data)
response = HTTPResponse(source)
response.begin()
return response
except HTTPException:
return None