HTTP response header - application version

I am trying to identify a specific web service assembly number (REST and SOAP interfaces) using HTTP in response to messages.

Just to be clear, I am not trying to control which version of the application is used by the client, since this is handled by the traffic manager and the service registry (it has also been discussed a lot), I only want to be able to debug later which version was used or used, for example, to check that the traffic manager is serving the correct version.

I looked at the HTTP specification for a long time and cannot decide between using Pragma

 Pragma: application-version=1.0.0-SNAPSHOT 

using the optional Server header

 Server: Apache-Coyote/1.1 Server: MyService-1.0.0-SNAPSHOT 

using Via

 Via: MyService-1.0.0-SNAPSHOT 

or customer header

 X-ApplicationVersion: 1.0.0-SNAPSHOT 

In my opinion, using Via or Server semantically incorrect, but using the X- header carries the risk of refusing a proxy, but Pragma has no restrictions and, therefore, is more difficult to parse if you want to use it programmatically.

I also have the feeling that multiple Server headers will not be respected, but there is no way to specify multiple values ​​with the container used (JBoss).

Is there a precedent for this?
Anyone have any tips?
Should I just shut up and use it?

+4
source share
1 answer

In my opinion, using a wiki or server is semantically incorrect, but using an X-header carries the risk of dropping proxies

I would not be too worried that the X headers are discarded. Take this call to ebay search service like

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=harry%20potter

The answer includes this header.

 X-EBAY-SOA-SERVICE-VERSION: 1.12.0 

I saw that the X headers were used for this purpose quite a lot.

+2
source

All Articles