Add X-OpenStack-Request-Id header

Make sure request id is returned in the X-OpenStack-Request-Id response
header so that clients/users can determine the id used to look up
corresponding logs.

Change-Id: Ied7b98629423545c23ce664b22525f3d8fb9d253
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-09-09 02:31:58 +09:00
parent 35ef19a68c
commit 245ab78e06
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
features:
- |
Now API returnes unique request identifier string in
the ``X-OpenStack-Request-Id`` header.

View File

@@ -18,6 +18,7 @@ import socket
from wsgiref import simple_server
from oslo_log import log as logging
from oslo_middleware import request_id
from oslo_utils import netutils
from zaqar.common import decorators
@@ -148,6 +149,8 @@ class Driver(transport.DriverBase):
self.app = auth.SignedAndExtraSpecHeadersAuth(self.app, auth_app)
self.app = request_id.RequestId(self.app)
# NOTE(wangxiyuan): Install CORS, this middleware should be called
# before Keystone auth.
self.app = cors.install_cors(self.app, auth_app, self._conf)