I could not find anything in the RFC docs about whether the User-Agent field needed to be formatted the way it commonly is. For example, could I just do:
User-Agent: Mozilla windows NT
and still pass a valid request?
I could not find anything in the RFC docs about whether the User-Agent field needed to be formatted the way it commonly is. For example, could I just do:
User-Agent: Mozilla windows NT
and still pass a valid request?
Sure, you can 'fake' a user agent. Check for yourself with this tool for instance: https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
The formal definition of the
User-Agent
header is defined in RFC 2616 Section 14.43 as follows:product
is defined in Section 3.8 as follows:token
andcomment
are defined in Section 2.2 as follows:Whitespace is a separator, so to answer your question,
Mozilla windows NT
is NOT a valid product by the abovetoken
definition. If you want to follow the spec, you could instead format it more like this:Mozilla (Windows NT)
.