Merge pull request #8108 from Icinga/bugfix/api-incorrect-response-header-6747

API: Send Content-Type as api response header too
This commit is contained in:
Alexander Aleksandrovič Klimov 2020-11-03 18:50:31 +01:00 committed by GitHub
commit 1450e1bb7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -257,7 +257,7 @@ bool HandleAccessControl(
if (request.method() == http::verb::options && !request[http::field::access_control_request_method].empty()) {
response.result(http::status::ok);
response.set(http::field::access_control_allow_methods, "GET, POST, PUT, DELETE");
response.set(http::field::access_control_allow_headers, "Authorization, X-HTTP-Method-Override");
response.set(http::field::access_control_allow_headers, "Authorization, Content-Type, X-HTTP-Method-Override");
response.body() = "Preflight OK";
response.set(http::field::content_length, response.body().size());
response.set(http::field::connection, "close");