-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Support (to close) #8
base: master
Are you sure you want to change the base?
Conversation
Merge tests
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
=========================================
Coverage ? 84.02%
=========================================
Files ? 15
Lines ? 1527
Branches ? 303
=========================================
Hits ? 1283
Misses ? 195
Partials ? 49
Continue to review full report at Codecov.
|
Is this windows support or HTTP support? |
"%HTTPRequest.Http_Version%" | ||
) | ||
|
||
# TODO: decide to keep or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we determine that now
Initializes the HTTP layer. | ||
""" | ||
Layer.__init__(self, layer) | ||
self.request = HTTPRequest(bytes(layer)) # TODO: I dont like this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do you want to change it?
""" | ||
Override get, since the HTTPRequest doesn't immediately make its fields known | ||
""" | ||
print('entering set, but I dont like this') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we clean this up if it's done
@@ -131,7 +142,7 @@ def setup_layers(self): | |||
""" | |||
layers = {} | |||
for layer in self.read_layers(): | |||
layers[layer.name.upper()] = layer | |||
layers[layer.name] = layer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does removing the .upper break other layers?
return self.layers[str_protocol].set(self.packet, field, value) | ||
lay = self.layers[str_protocol].set(self.packet, field, value) | ||
|
||
print(lay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove?
return None | ||
|
||
if index > len(packet["HTTPRequest"].fields[header]): | ||
# TODO: throw some sort of error, this index is too large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, assert
return None | ||
|
||
if index+len(content) > len(packet["HTTPRequest"].fields[header]): | ||
# TODO: throw some sort of error, this index is too large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments for these TODOs
return None | ||
|
||
if end_index+1 > len(packet["HTTPRequest"].fields[header]): | ||
# TODO: throw some sort of error, this index is too large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and these
""" | ||
Helper method to remove the characters at header[start_index] to header[end_index] | ||
""" | ||
print("in cor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
# Filter for IPv4 addresses | ||
if netifaces.AF_INET in info: | ||
return iface | ||
if os.name == 'nt': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your branching is funky - see my comments on the windows code review (#14) for the rest of this
HTTP support will come in a different branch (soonish). Changing name, but need to merge Windows code first and make some additional changes to HTTP. |
Now uses ABC and allows for indexing into strategy array.
We will want to change this once we move over to the actual library.