Skip to content

Commit 4aa213a

Browse files
authored
fix CORS headers for traces (#8458)
1 parent 8a5c10d commit 4aa213a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ydb/core/mon/async_http_mon.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ class THttpMonLegacyActorRequest : public TActorBootstrapped<THttpMonLegacyActor
247247
response << "HTTP/1.1 204 No Content\r\n"
248248
"Access-Control-Allow-Origin: " << origin << "\r\n"
249249
"Access-Control-Allow-Credentials: true\r\n"
250-
"Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace\r\n"
251-
"Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, DELETE\r\n"
250+
"Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace,traceparent\r\n"
251+
"Access-Control-Expose-Headers: traceresponse,X-Worker-Name\r\n"
252+
"Access-Control-Allow-Methods: OPTIONS,GET,POST,PUT,DELETE\r\n"
252253
"Content-Type: " << type << "\r\n"
253254
"Connection: keep-alive\r\n\r\n";
254255
ReplyWith(request->CreateResponseString(response));

ydb/core/viewer/viewer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,9 @@ void TViewer::FillCORS(TStringBuilder& stream, const TRequestState& request) {
595595
if (origin) {
596596
stream << "Access-Control-Allow-Origin: " << origin << "\r\n"
597597
<< "Access-Control-Allow-Credentials: true\r\n"
598-
<< "Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace\r\n"
599-
<< "Access-Control-Allow-Methods: OPTIONS, GET, POST, DELETE\r\n"
598+
<< "Access-Control-Allow-Headers: Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace,traceparent\r\n"
599+
<< "Access-Control-Expose-Headers: traceresponse,X-Worker-Name\r\n"
600+
<< "Access-Control-Allow-Methods: OPTIONS,GET,POST,PUT,DELETE\r\n"
600601
<< "Allow: OPTIONS, GET, POST, DELETE\r\n";
601602
}
602603
}

0 commit comments

Comments
 (0)