Closed omribentov closed 10 years ago
Hi Omri, I've decided to go for 'User-Agent' (because I expect it to be written that way :) ). This choice does have this drawback, but it's easily fixed like so:
print pkt[HTTPRequest].fields['User-Agent']
prints out
'Wget/1.13.4 (linux-gnu)'
Thanks, I didn't know the syntax.
On Wed, Jul 23, 2014 at 1:14 PM, Luca Invernizzi notifications@github.com wrote:
Hi Omri, I've decided to go for 'User-Agent' (because I expect it to be written that way :) ). This choice does have this drawback, but it's easily fixed like so:
print pkt[HTTPRequest].fields['User-Agent']
prints out
'Wget/1.13.4 (linux-gnu)'
— Reply to this email directly or view it on GitHub https://github.com/invernizzi/scapy-http/issues/7#issuecomment-49855834.
Hi,
I'm trying to user scapy_http, but I have a problem of referncing fields that have a "-" in them.
So doing something like pkt[HTTPRequest].Host is OK, but pkt[HTTPRequest].User-Agent is not.
I saw that in Steeve Barbeau's original code he used different lists for the fields_rfc(e.g. User-Agent) and the fields_desc(UserAgent), thus allowing to reference the user agent by pkt[HTTPRequest].UserAgent.
Is there a way to do something like this ???
Tnx,
Omri