GNOME Bugzilla – Bug 747816
Add ServerName header when responding to HTTP Requests
Last modified: 2016-02-13 23:06:10 UTC
Created attachment 301503 [details] [review]
Add Server header in HTTP response
This is an enhancement patch to add "Server" header when responding to HTTP
requests. This has been helpful when performing debugging in the network more easily when more than one Rygel instances are connected to the same network.
Review of attachment 301503 [details] [review]:
@@ +208,3 @@
+ this.msg.response_headers.append ("Server",
+ MetaConfig.get_default ().get_string ("general", "servername"));
This will throw an error unneccessarily for all those people that run rygel with an old config
Do you prefer it to be placed in Rygel.UserConfig with its own getter?
No, get_string will throw an error if it's not found.
Either set a default in the catch() or not set it at all as it is currently.
Taking a (very) quick look at the DLNA spec, there doesn't seem to be a mention of the Server header outside of the CVP stuff, so I'd opt for nothing as it is currently or the UPnP server header "OS/Version UPnP/1.0 Rygel/Version"?
Yes, I see your point. Pardon my ignorance, is there an api that is currently being used to get the OS version and Rygel version.
I dont want to a different mechanism to get these values if there is one already available and working.
Rygel version is available through BuildConfig.PACKAGE_VERSION.
Wonder which format to use though, the DLNA spec says
Rygel/version DLNADOC/1.5x UPnP/1.0
Created attachment 321088 [details] [review]
server: Add "Sever:" header
We append a Server header to the HTTP response.
Default is plugin/version g_get_prgname()/version DLNA/1.51 UPnP/1.0
It is configurable on a per-plugin base using the key "server-name"
Signed-off-by: Jens Georg <email@example.com>
Attachment 321088 [details] pushed as d78337c - server: Add "Sever:" header