Skip to content

Commit

Permalink
fix CORS headers for traces (ydb-platform#8458)
Browse files Browse the repository at this point in the history
  • Loading branch information
adameat authored Aug 29, 2024
1 parent 8a5c10d commit 4aa213a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ydb/core/mon/async_http_mon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ class THttpMonLegacyActorRequest : public TActorBootstrapped<THttpMonLegacyActor
response << "HTTP/1.1 204 No Content\r\n"
"Access-Control-Allow-Origin: " << origin << "\r\n"
"Access-Control-Allow-Credentials: true\r\n"
"Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace\r\n"
"Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, DELETE\r\n"
"Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace,traceparent\r\n"
"Access-Control-Expose-Headers: traceresponse,X-Worker-Name\r\n"
"Access-Control-Allow-Methods: OPTIONS,GET,POST,PUT,DELETE\r\n"
"Content-Type: " << type << "\r\n"
"Connection: keep-alive\r\n\r\n";
ReplyWith(request->CreateResponseString(response));
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/viewer/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,9 @@ void TViewer::FillCORS(TStringBuilder& stream, const TRequestState& request) {
if (origin) {
stream << "Access-Control-Allow-Origin: " << origin << "\r\n"
<< "Access-Control-Allow-Credentials: true\r\n"
<< "Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace\r\n"
<< "Access-Control-Allow-Methods: OPTIONS, GET, POST, DELETE\r\n"
<< "Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace,traceparent\r\n"
<< "Access-Control-Expose-Headers: traceresponse,X-Worker-Name\r\n"
<< "Access-Control-Allow-Methods: OPTIONS,GET,POST,PUT,DELETE\r\n"
<< "Allow: OPTIONS, GET, POST, DELETE\r\n";
}
}
Expand Down

0 comments on commit 4aa213a

Please sign in to comment.