Support PUT/DELETE/PATCH/HEAD/OPTIONS/TRACE methods #43

This commit is contained in:
Francis Dong
2021-02-03 16:56:39 +08:00
parent f923d2aaf1
commit fc24d5a1aa
2 changed files with 5 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ public class AggregateFilter implements WebFilter {
String path = WebUtils.getClientReqPathPrefix(exchange) + serviceId + WebUtils.getBackendPath(exchange);
String method = request.getMethodValue();
if (HttpMethod.HEAD.matches(method.toUpperCase())) {
method = HttpMethod.GET.name();
}
AggregateResource aggregateResource = configLoader.matchAggregateResource(method, path);
if (aggregateResource == null) {
if (WebUtils.getApiConfigType(exchange) == ApiConfig.Type.SERVICE_ARRANGE) {

View File

@@ -60,6 +60,8 @@ public class CorsFilterConfig {
config.addAllowedMethod(HttpMethod.HEAD);
config.addAllowedMethod(HttpMethod.PUT);
config.addAllowedMethod(HttpMethod.DELETE);
config.addAllowedMethod(HttpMethod.PATCH);
config.addAllowedMethod(HttpMethod.TRACE);
config.addAllowedHeader("*");