From b02a95a18b5da37db6d4f30a5dea07e2a4187245 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Mon, 14 Jun 2021 16:53:02 -0400 Subject: [PATCH] Allow X-OpenStack-Nova-API-Version header in CORS By default, we don't currently allow the Nova microversion header for CORS requests. It should be something that is included out of the box because it's part of the core API. Deployers can workaround this by overriding allow_headers, but we should provide a better experience out of the box. Closes-Bug: #1931908 Change-Id: Idf4650f36952331f02d7512580c21451f3ee3b63 --- nova/middleware.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nova/middleware.py b/nova/middleware.py index 717fecd4efe4..8b0fc5956158 100644 --- a/nova/middleware.py +++ b/nova/middleware.py @@ -24,11 +24,15 @@ def set_defaults(): 'X-Roles', 'X-Service-Catalog', 'X-User-Id', - 'X-Tenant-Id'], + 'X-Tenant-Id', + 'X-OpenStack-Nova-API-Version', + 'OpenStack-API-Version'], expose_headers=['X-Auth-Token', 'X-Openstack-Request-Id', 'X-Subject-Token', - 'X-Service-Token'], + 'X-Service-Token', + 'X-OpenStack-Nova-API-Version', + 'OpenStack-API-Version'], allow_methods=['GET', 'PUT', 'POST',