Fix version header in the response

This patch updates response header
from OpenStack-API-Version: [VERSION_STRING]
to OpenStack-API-Version: [SERVICE_TYPE] [VERSION_STRING]

Change-Id: I10577ff1123ef781bd4aa0b26577574a3f7e9c39
This commit is contained in:
licanwei
2018-11-09 10:44:35 +08:00
committed by Hidekazu Nakamura
parent 59cae3268e
commit 9f09abd6ec
2 changed files with 10 additions and 5 deletions

View File

@@ -250,7 +250,8 @@ class Controller(rest.RestController):
# assert that requested version is supported
self._check_version(v, pecan.response.headers)
pecan.response.headers[base.Version.string] = str(v)
pecan.response.headers[base.Version.string] = (
' '.join([versions.service_type_string(), str(v)]))
pecan.request.version = v
return super(Controller, self)._route(args, request)