Skip to content

Requests with duplicate User-Agent HTTP headers fail to log to analytics #309

@GUI

Description

@GUI

I spotted a recent uptick of some errors in the web server logs due to specific requests failing to go into the analytics database. The issue was related to requests that had multiple User-Agent HTTP headers present, like:

curl -v -H "User-Agent: foo" -H "User-Agent: bar" "http://example.com/"
> GET / HTTP/1.1
> Host: example.com
> Accept: */*
> User-Agent: foo
> User-Agent: bar

User-Agent is not a HTTP header that technically supports multiple values (other headers do), but if two separate User-Agent headers were given, we were parsing that as an array of multiple values, which confused some subsequent processing that was expecting a string value.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions