Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#1349] improvement(server-common): Modify the default value of allowMethods for CorsFilter (#1348)

qqqttt123dbafc8f094d1
diff --git a/docs/security.md b/docs/security.md
index 8289d9f634..55b19111a9 100644
--- a/docs/security.md
+++ b/docs/security.md
@@ -262,28 +262,28 @@ curl -v -X GET --cacert ./certificate.pem -H "Accept: application/vnd.gravitino.
### Server configuration
-| Configuration item | Description | Default value | Required | Since version |
-|----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|----------|---------------|
-| `gravitino.server.webserver.enableCorsFilter` | Enable cross-origin resource share filter. | false | No | 0.4.0 |
-| `gravitino.server.webserver.allowedOrigins` | A comma separated list of allowed origins to access the resources. The default value is *, which means all origins. | `*` | No | 0.4.0 |
-| `gravitino.server.webserver.allowedTimingOrigins` | A comma separated list of allowed origins to time the resource. The default value is the empty string, which means no origins. | `` | No | 0.4.0 |
-| `gravitino.server.webserver.allowedMethods` | A comma separated list of allowed HTTP methods used when accessing the resources. The default values are GET, POST, HEAD, and DELETE. | `GET,POST,HEAD,DELETE` | No | 0.4.0 |
-| `gravitino.server.webserver.allowedHeaders` | A comma separated list of allowed HTTP headers specified when accessing the resources. The default value is X-Requested-With,Content-Type,Accept,Origin. If the value is a single *, it accepts all headers. | `X-Requested-With,Content-Type,Accept,Origin` | No | 0.4.0 |
+| Configuration item | Description | Default value | Required | Since version |
+|----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|----------|---------------|
+| `gravitino.server.webserver.enableCorsFilter` | Enable cross-origin resource share filter. | false | No | 0.4.0 |
+| `gravitino.server.webserver.allowedOrigins` | A comma separated list of allowed origins to access the resources. The default value is *, which means all origins. | `*` | No | 0.4.0 |
+| `gravitino.server.webserver.allowedTimingOrigins` | A comma separated list of allowed origins to time the resource. The default value is the empty string, which means no origins. | `` | No | 0.4.0 |
+| `gravitino.server.webserver.allowedMethods` | A comma separated list of allowed HTTP methods used when accessing the resources. The default values are GET, POST, HEAD, and DELETE. | `GET,POST,HEAD,DELETE,PUT` | No | 0.4.0 |
+| `gravitino.server.webserver.allowedHeaders` | A comma separated list of allowed HTTP headers specified when accessing the resources. The default value is X-Requested-With,Content-Type,Accept,Origin. If the value is a single *, it accepts all headers. | `X-Requested-With,Content-Type,Accept,Origin` | No | 0.4.0 |
| `gravitino.server.webserver.preflightMaxAgeInSecs` | The number of seconds to cache preflight requests by the client. The default value is 1800 seconds or 30 minutes. | `1800` | No | 0.4.0 |
-| `gravitino.server.webserver.allowCredentials` | A boolean indicating if the resource allows requests with credentials. The default value is true. | `true` | No | 0.4.0 |
-| `gravitino.server.webserver.exposedHeaders` | A comma separated list of allowed HTTP headers exposed on the client. The default value is the empty list. | `` | No | 0.4.0 |
-| `gravitino.server.webserver.chainPreflight` | If true chained preflight requests for normal handling (as an OPTION request). Otherwise, the filter responds to the preflight. The default is true. | `true` | No | 0.4.0 |
+| `gravitino.server.webserver.allowCredentials` | A boolean indicating if the resource allows requests with credentials. The default value is true. | `true` | No | 0.4.0 |
+| `gravitino.server.webserver.exposedHeaders` | A comma separated list of allowed HTTP headers exposed on the client. The default value is the empty list. | `` | No | 0.4.0 |
+| `gravitino.server.webserver.chainPreflight` | If true chained preflight requests for normal handling (as an OPTION request). Otherwise, the filter responds to the preflight. The default is true. | `true` | No | 0.4.0 |
### Iceberg REST service's configuration
-| Configuration item | Description | Default value | Required | Since version |
-|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|----------|---------------|
-| `gravitino.auxService.iceberg-rest.enableCorsFilter` | Enable cross-origin resource share filter. | false | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.allowedOrigins` | A comma separated list of allowed origins that access the resources. The default value is *, which means all origins. | `*` | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.allowedTimingOrigins` | A comma separated list of allowed origins that time the resource. The default value is the empty string, which means no origins. | `` | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.allowedMethods` | A comma separated list of allowed HTTP methods used when accessing the resources. The default values are GET, POST, HEAD, and DELETE. | `GET,POST,HEAD,DELETE` | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.allowedHeaders` | A comma separated list of HTTP allowed headers specified when accessing the resources. The default value is X-Requested-With,Content-Type,Accept,Origin. If the value is a single *, it accepts all headers.| `X-Requested-With,Content-Type,Accept,Origin` | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.preflightMaxAgeInSecs` | The number of seconds to cache preflight requests by the client. The default value is 1800 seconds or 30 minutes. | `1800` | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.allowCredentials` | A boolean indicating if the resource allows requests with credentials. The default value is true. | `true` | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.exposedHeaders` | A comma separated list of allowed HTTP headers exposed on the client. The default value is the empty list. | `` | No | 0.4.0 |
-| `gravitino.auxService.iceberg-rest.chainPreflight` | If true chained preflight requests for normal handling (as an OPTION request). Otherwise, the filter responds to the preflight. The default is true. | `true` | No | 0.4.0 |
+| Configuration item | Description | Default value | Required | Since version |
+|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|----------|---------------|
+| `gravitino.auxService.iceberg-rest.enableCorsFilter` | Enable cross-origin resource share filter. | false | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.allowedOrigins` | A comma separated list of allowed origins that access the resources. The default value is *, which means all origins. | `*` | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.allowedTimingOrigins` | A comma separated list of allowed origins that time the resource. The default value is the empty string, which means no origins. | `` | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.allowedMethods` | A comma separated list of allowed HTTP methods used when accessing the resources. The default values are GET, POST, HEAD, and DELETE. | `GET,POST,HEAD,DELETE,PUT` | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.allowedHeaders` | A comma separated list of HTTP allowed headers specified when accessing the resources. The default value is X-Requested-With,Content-Type,Accept,Origin. If the value is a single *, it accepts all headers. | `X-Requested-With,Content-Type,Accept,Origin` | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.preflightMaxAgeInSecs` | The number of seconds to cache preflight requests by the client. The default value is 1800 seconds or 30 minutes. | `1800` | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.allowCredentials` | A boolean indicating if the resource allows requests with credentials. The default value is true. | `true` | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.exposedHeaders` | A comma separated list of allowed HTTP headers exposed on the client. The default value is the empty list. | `` | No | 0.4.0 |
+| `gravitino.auxService.iceberg-rest.chainPreflight` | If true chained preflight requests for normal handling (as an OPTION request). Otherwise, the filter responds to the preflight. The default is true. | `true` | No | 0.4.0 |
diff --git a/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServerConfig.java b/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServerConfig.java
index aa69411218..966fae87b8 100644
--- a/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServerConfig.java
+++ b/server-common/src/main/java/com/datastrato/gravitino/server/web/JettyServerConfig.java
@@ -226,7 +226,7 @@ public final class JettyServerConfig {
+ " Default value is GET,POST,HEAD,DELETE")
.version("0.4.0")
.stringConf()
- .createWithDefault("GET,POST,HEAD,DELETE");
+ .createWithDefault("GET,POST,HEAD,DELETE,PUT");
public static final ConfigEntry<String> ALLOWED_HEADERS =
new ConfigBuilder("allowedHeaders")