mansonliwh commented on code in PR #3244:
URL: https://github.com/apache/amoro/pull/3244#discussion_r1799092736
##########
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/DashboardServer.java:
##########
@@ -355,7 +354,8 @@ private EndpointGroup apiGroup() {
public void preHandleRequest(Context ctx) {
String uriPath = ctx.path();
- if (needApiKeyCheck(uriPath)) {
+ String requestSource = ctx.header("X-Request-Source");
+ if (needApiKeyCheck(uriPath) && !"frontend".equals(requestSource)) {
Review Comment:
> Is `Web` a proper name for requests from the front end?
>
> And we may better declare a static final variable for it, and the same to
`X-Request-Source`
Thank you for your reasonable suggestions. I will optimize the code
accordingly.
##########
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/DashboardServer.java:
##########
@@ -355,7 +354,8 @@ private EndpointGroup apiGroup() {
public void preHandleRequest(Context ctx) {
String uriPath = ctx.path();
- if (needApiKeyCheck(uriPath)) {
+ String requestSource = ctx.header("X-Request-Source");
+ if (needApiKeyCheck(uriPath) && !"frontend".equals(requestSource)) {
Review Comment:
Thank you for your reasonable suggestions. I will optimize the code
accordingly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]