Opened 9 years ago
Closed 9 years ago
#12262 closed enhancement (fixed)
Changes to User Agent to Include a Version of the Application
Reported by: | apl-haiku | Owned by: | waddlesplash |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Applications/HaikuDepot | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
The User-Agent HTTP header is presently "X-HDS-Client", but should be "HaikuDepot/x.y.z" where "x.y.z" is the version of the HaikuDepot application. Stephan; are you able to see if this is OK for me?
Attachments (1)
Change History (7)
comment:1 by , 9 years ago
patch: | 0 → 1 |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
I'm building the user agent string as a static member variable because the "WebAppInterface" is instantiated in more than one place in the application and I don't want it to be encumbered with the overhead of reading the application version each time.
I've expanded the includes and added more checks for error states. I've also re-arranged the code a bit to make the error handling less onerous around deriving the version string through early-exit.
Patch re-attached.
by , 9 years ago
Attachment: | 0001-HaikuDepot-enhancements-to-the-User-Agent-header-to-.patch added |
---|
comment:4 by , 9 years ago
Sorry - somehow the last iteration of the patch was the wrong version. I have re-attached the updated patch now.
comment:5 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → in-progress |
comment:6 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | in-progress → closed |
Applied in hrev49515. Thanks!
Several checks are missing. For instance:
It's also better when you can exactly include what you need instead of StorageKit.h or AppKit.h.
Also the default constructor is automatically called:
What I don't understand is why you don't build the user agent string on WebAppInterface construction, instead of lazily. Also why the static keyword? Are there several WebAppInterface instances involved?