Skip to content

Commit 7b9c7e3

Browse files
authored
add cors headers to oidc proxy (#11450)
1 parent 8c8ed07 commit 7b9c7e3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ydb/mvp/oidc_proxy/oidc_proxy_ut.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,10 @@ Y_UNIT_TEST_SUITE(Mvp) {
560560
UNIT_ASSERT_STRINGS_EQUAL("true", headers.Get(accessControlAllowCredentials));
561561

562562
UNIT_ASSERT(headers.Has(accessControlAllowHeaders));
563-
UNIT_ASSERT_STRINGS_EQUAL("Content-Type,Authorization,Origin,Accept", headers.Get(accessControlAllowHeaders));
563+
UNIT_ASSERT_STRINGS_EQUAL("Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace,traceparent", headers.Get(accessControlAllowHeaders));
564564

565565
UNIT_ASSERT(headers.Has(accessControlAllowMethods));
566-
UNIT_ASSERT_STRINGS_EQUAL("OPTIONS, GET, POST", headers.Get(accessControlAllowMethods));
566+
UNIT_ASSERT_STRINGS_EQUAL("OPTIONS,GET,POST,PUT,DELETE", headers.Get(accessControlAllowMethods));
567567
}
568568

569569
bool IsAjaxRequest() const override {

ydb/mvp/oidc_proxy/openid_connect.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ void SetCORS(const NHttp::THttpIncomingRequestPtr& request, NHttp::THeadersBuild
5050
}
5151
headers->Set("Access-Control-Allow-Origin", origin);
5252
headers->Set("Access-Control-Allow-Credentials", "true");
53-
headers->Set("Access-Control-Allow-Headers", "Content-Type,Authorization,Origin,Accept");
54-
headers->Set("Access-Control-Allow-Methods", "OPTIONS, GET, POST");
53+
headers->Set("Access-Control-Allow-Headers", "Content-Type,Authorization,Origin,Accept,X-Trace-Verbosity,X-Want-Trace,traceparent");
54+
headers->Set("Access-Control-Expose-Headers", "traceresponse,X-Worker-Name");
55+
headers->Set("Access-Control-Allow-Methods", "OPTIONS,GET,POST,PUT,DELETE");
56+
headers->Set("Allow", "OPTIONS,GET,POST,PUT,DELETE");
5557
}
5658

5759
TString HmacSHA256(TStringBuf key, TStringBuf data) {

0 commit comments

Comments
 (0)