Bug #6663
closed
Metacat does not record http request "User-Agent" into the event log
Added by Peter Slaughter almost 10 years ago.
Updated almost 10 years ago.
Description
All entries in the 'access_log' table on KNB have user_agent equal to NULL, i.e. the query
"select count(*) from access_log where user_agent IS NOT NULL;" returns 0. In MetacatHandler.readFromMetacat,
for example, userAgent is passed to EventLog but nulls are being recorded.
- Assignee changed from ben leinfelder to Jing Tao
It turned out the constructor of EventLogData class didn't have the field for user-agent.
I found the user-agent can be very long. For example, it is "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" for using Chrome browser to get an object.
In our access_log table, the length of the column of user_agent is 512. So I will add a check to the user agent before we write it to database, if its length is less than or equals 512, we will write all of them to database; otherwise, we only write first 512 characters.
- Status changed from New to Resolved
The source and test code was committed to both trunk and 2.4 branch.
- Target version changed from 2.5.0 to 2.4.3
Also available in: Atom
PDF