From 7b72fb11dd694fda51b2a5b9481fe6002ef14671 Mon Sep 17 00:00:00 2001 From: hongqiaowei Date: Tue, 24 Aug 2021 11:44:55 +0800 Subject: [PATCH 1/6] demo --- .../src/main/java/we/MyApiConfig.java | 43 +++++++++++++++++++ .../java/we/plugin/myplugin/MyPlugin.java | 21 +++++++++ 2 files changed, 64 insertions(+) create mode 100644 fizz-bootstrap/src/main/java/we/MyApiConfig.java create mode 100644 fizz-plugin/src/main/java/we/plugin/myplugin/MyPlugin.java diff --git a/fizz-bootstrap/src/main/java/we/MyApiConfig.java b/fizz-bootstrap/src/main/java/we/MyApiConfig.java new file mode 100644 index 0000000..8099b54 --- /dev/null +++ b/fizz-bootstrap/src/main/java/we/MyApiConfig.java @@ -0,0 +1,43 @@ +package we; + +import org.springframework.context.annotation.Configuration; +import we.config.ManualApiConfig; +import we.plugin.PluginConfig; +import we.plugin.auth.ApiConfig; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * 定义 MyApiConfig 继承 ManualApiConfig, 并注解为 Configuration, + * 然后实现 setApiConfigs 方法,在方法中添加路由配置 + */ +@Configuration +public class MyApiConfig extends ManualApiConfig { + + @Override + public List setApiConfigs() { + + List apiConfigs = new ArrayList<>(); + + ApiConfig ac = new ApiConfig(); // 一个路由配置 + ac.id = 1000; // 路由 id,建议从 1000 开始 + ac.service = "xservice"; // 前端服务名 + ac.path = "/ypath"; // 前端路径 + ac.type = ApiConfig.Type.REVERSE_PROXY; // 路由类型,此处为反向代理 + ac.httpHostPorts = Collections.singletonList("http://127.0.0.1:9094"); // 被代理接口的地址 + // ac.httpHostPorts = Collections.singletonList("https://self-signed.badssl.com"); + ac.backendPath = "/@ypath"; // 被代理接口的路径 + // ac.backendPath = "/"; + ac.pluginConfigs = new ArrayList<>(); + PluginConfig pc = new PluginConfig(); + pc.plugin = "myPlugin"; // 应用 id 为 myPlugin 的插件 + ac.pluginConfigs.add(pc); + + apiConfigs.add(ac); + + log.info("set api configs end"); + return apiConfigs; // 返回路由配置 + } +} diff --git a/fizz-plugin/src/main/java/we/plugin/myplugin/MyPlugin.java b/fizz-plugin/src/main/java/we/plugin/myplugin/MyPlugin.java new file mode 100644 index 0000000..753d65c --- /dev/null +++ b/fizz-plugin/src/main/java/we/plugin/myplugin/MyPlugin.java @@ -0,0 +1,21 @@ +package we.plugin.myplugin; + +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; +import we.plugin.FizzPluginFilter; +import we.plugin.FizzPluginFilterChain; + +import java.util.Map; + +@Component(MyPlugin.MY_PLUGIN) // 必须,且为插件 id +public class MyPlugin implements FizzPluginFilter { + + public static final String MY_PLUGIN = "myPlugin"; // 插件 id + + @Override + public Mono filter(ServerWebExchange exchange, Map config) { + System.err.println("this is my plugin"); // 本插件只输出这个 + return FizzPluginFilterChain.next(exchange); // 执行后续逻辑 + } +} From 513216ff4f4ec371aabb26c78ed4cd7a7f643155 Mon Sep 17 00:00:00 2001 From: hongqiaowei Date: Tue, 24 Aug 2021 11:55:57 +0800 Subject: [PATCH 2/6] Change version to 2.2.4-we-code --- fizz-bootstrap/pom.xml | 2 +- fizz-common/pom.xml | 2 +- fizz-core/pom.xml | 2 +- fizz-plugin/pom.xml | 2 +- fizz-spring-boot-starter/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fizz-bootstrap/pom.xml b/fizz-bootstrap/pom.xml index 78d3815..8658ba4 100644 --- a/fizz-bootstrap/pom.xml +++ b/fizz-bootstrap/pom.xml @@ -12,7 +12,7 @@ com.fizzgate fizz-bootstrap - 2.2.4-beta4 + 2.2.4-we-code 1.8 diff --git a/fizz-common/pom.xml b/fizz-common/pom.xml index 193963b..43f5590 100644 --- a/fizz-common/pom.xml +++ b/fizz-common/pom.xml @@ -5,7 +5,7 @@ fizz-gateway-community com.fizzgate - 2.2.4-beta4 + 2.2.4-we-code ../pom.xml 4.0.0 diff --git a/fizz-core/pom.xml b/fizz-core/pom.xml index 3691a2c..49195b5 100644 --- a/fizz-core/pom.xml +++ b/fizz-core/pom.xml @@ -5,7 +5,7 @@ fizz-gateway-community com.fizzgate - 2.2.4-beta4 + 2.2.4-we-code ../pom.xml 4.0.0 diff --git a/fizz-plugin/pom.xml b/fizz-plugin/pom.xml index 0547562..1137c71 100644 --- a/fizz-plugin/pom.xml +++ b/fizz-plugin/pom.xml @@ -5,7 +5,7 @@ fizz-gateway-community com.fizzgate - 2.2.4-beta4 + 2.2.4-we-code ../pom.xml 4.0.0 diff --git a/fizz-spring-boot-starter/pom.xml b/fizz-spring-boot-starter/pom.xml index 6534140..c7a626d 100644 --- a/fizz-spring-boot-starter/pom.xml +++ b/fizz-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ fizz-gateway-community com.fizzgate - 2.2.4-beta4 + 2.2.4-we-code ../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 2748f36..5ebd81b 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ fizz-gateway-community ${project.artifactId} fizz gateway community - 2.2.4-beta4 + 2.2.4-we-code pom fizz-common From a1e549323521d62dfb286adc6a3d108fbe8a5c90 Mon Sep 17 00:00:00 2001 From: hongqiaowei Date: Mon, 6 Sep 2021 19:22:36 +0800 Subject: [PATCH 3/6] Code style --- fizz-bootstrap/pom.xml | 4 +--- fizz-common/pom.xml | 5 +---- fizz-core/pom.xml | 5 +---- fizz-plugin/pom.xml | 5 +---- fizz-spring-boot-starter/pom.xml | 5 +---- pom.xml | 4 +--- 6 files changed, 6 insertions(+), 22 deletions(-) diff --git a/fizz-bootstrap/pom.xml b/fizz-bootstrap/pom.xml index a9e6cd1..0e213f3 100644 --- a/fizz-bootstrap/pom.xml +++ b/fizz-bootstrap/pom.xml @@ -9,11 +9,9 @@ 2.2.13.RELEASE - com.fizzgate fizz-bootstrap - - 2.3.0 + 2.3.0-we-code 1.8 diff --git a/fizz-common/pom.xml b/fizz-common/pom.xml index f47b0c7..3cf6c59 100644 --- a/fizz-common/pom.xml +++ b/fizz-common/pom.xml @@ -5,13 +5,10 @@ fizz-gateway-community com.fizzgate - - 2.3.0 - + 2.3.0-we-code ../pom.xml 4.0.0 - fizz-common diff --git a/fizz-core/pom.xml b/fizz-core/pom.xml index 517d6c6..24e1e86 100644 --- a/fizz-core/pom.xml +++ b/fizz-core/pom.xml @@ -5,13 +5,10 @@ fizz-gateway-community com.fizzgate - - 2.3.0 - + 2.3.0-we-code ../pom.xml 4.0.0 - fizz-core diff --git a/fizz-plugin/pom.xml b/fizz-plugin/pom.xml index f43a51c..e8626db 100644 --- a/fizz-plugin/pom.xml +++ b/fizz-plugin/pom.xml @@ -5,13 +5,10 @@ fizz-gateway-community com.fizzgate - - 2.3.0 - + 2.3.0-we-code ../pom.xml 4.0.0 - fizz-plugin diff --git a/fizz-spring-boot-starter/pom.xml b/fizz-spring-boot-starter/pom.xml index 585c7db..44a638a 100644 --- a/fizz-spring-boot-starter/pom.xml +++ b/fizz-spring-boot-starter/pom.xml @@ -5,13 +5,10 @@ fizz-gateway-community com.fizzgate - - 2.3.0 - + 2.3.0-we-code ../pom.xml 4.0.0 - fizz-spring-boot-starter diff --git a/pom.xml b/pom.xml index 83112eb..415a7e0 100644 --- a/pom.xml +++ b/pom.xml @@ -34,9 +34,7 @@ fizz-gateway-community ${project.artifactId} fizz gateway community - - 2.3.0 - + 2.3.0-we-code pom fizz-common From 0b546bc0e4aa0d1ff3af0963e0fac39a18041f5d Mon Sep 17 00:00:00 2001 From: hongqiaowei Date: Thu, 16 Sep 2021 18:07:49 +0800 Subject: [PATCH 4/6] Add FizzServerWebExchangeDecorator --- .../ext/FizzServerWebExchangeDecorator.java | 103 ++++++++++++++++++ .../plugin/requestbody/RequestBodyPlugin.java | 18 ++- 2 files changed, 115 insertions(+), 6 deletions(-) create mode 100644 fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java diff --git a/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java b/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java new file mode 100644 index 0000000..831cc55 --- /dev/null +++ b/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2020 the original author or authors. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package we.spring.web.server.ext; + +import org.springframework.http.MediaType; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.lang.Nullable; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.server.ServerWebExchange; +import org.springframework.web.server.ServerWebExchangeDecorator; +import reactor.core.publisher.Mono; +import we.util.NettyDataBufferUtils; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * @author hongqiaowei + */ + +public class FizzServerWebExchangeDecorator extends ServerWebExchangeDecorator { + + private static final MultiValueMap EMPTY_FORM_DATA = CollectionUtils.unmodifiableMultiValueMap(new LinkedMultiValueMap(0)); + + private static final Mono> EMPTY_FORM_DATA_MONO = Mono.just(EMPTY_FORM_DATA).cache(); + + public FizzServerWebExchangeDecorator(ServerWebExchange delegate) { + super(delegate); + } + + private Charset getMediaTypeCharset(@Nullable MediaType mediaType) { + if (mediaType != null && mediaType.getCharset() != null) { + return mediaType.getCharset(); + } else { + return StandardCharsets.UTF_8; + } + } + + private MultiValueMap parseFormData(Charset charset, String source) { + String[] pairs = StringUtils.tokenizeToStringArray(source, "&"); + MultiValueMap result = new LinkedMultiValueMap<>(pairs.length); + try { + for (String pair : pairs) { + int idx = pair.indexOf('='); + if (idx == -1) { + result.add(URLDecoder.decode(pair, charset.name()), null); + } else { + String name = URLDecoder.decode(pair.substring(0, idx), charset.name()); + String value = URLDecoder.decode(pair.substring(idx + 1), charset.name()); + result.add(name, value); + } + } + } catch (UnsupportedEncodingException ex) { + throw new IllegalStateException(ex); + } + return result; + } + + @Override + public Mono> getFormData() { + ServerHttpRequest req = getDelegate().getRequest(); + MediaType ct = req.getHeaders().getContentType(); + if (MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(ct)) { + Charset charset = getMediaTypeCharset(ct); + return + req.getBody().defaultIfEmpty(NettyDataBufferUtils.EMPTY_DATA_BUFFER) + .single() + .map( + body -> { + if (body == NettyDataBufferUtils.EMPTY_DATA_BUFFER) { + return EMPTY_FORM_DATA; + } else { + CharBuffer charBuffer = charset.decode(body.asByteBuffer()); + return parseFormData(charset, charBuffer.toString()); + } + } + ); + } else { + return EMPTY_FORM_DATA_MONO; + } + } +} diff --git a/fizz-core/src/main/java/we/plugin/requestbody/RequestBodyPlugin.java b/fizz-core/src/main/java/we/plugin/requestbody/RequestBodyPlugin.java index 6f81e25..0823be5 100644 --- a/fizz-core/src/main/java/we/plugin/requestbody/RequestBodyPlugin.java +++ b/fizz-core/src/main/java/we/plugin/requestbody/RequestBodyPlugin.java @@ -20,6 +20,7 @@ package we.plugin.requestbody; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.stereotype.Component; import org.springframework.web.server.ServerWebExchange; @@ -28,6 +29,7 @@ import we.flume.clients.log4j2appender.LogService; import we.plugin.FizzPluginFilter; import we.plugin.FizzPluginFilterChain; import we.spring.http.server.reactive.ext.FizzServerHttpRequestDecorator; +import we.spring.web.server.ext.FizzServerWebExchangeDecorator; import we.util.NettyDataBufferUtils; import java.util.Map; @@ -51,19 +53,23 @@ public class RequestBodyPlugin implements FizzPluginFilter { NettyDataBufferUtils.join(req.getBody()).defaultIfEmpty(NettyDataBufferUtils.EMPTY_DATA_BUFFER) .flatMap( body -> { - ServerWebExchange newExchange = exchange; + FizzServerHttpRequestDecorator requestDecorator = new FizzServerHttpRequestDecorator(req); if (body != NettyDataBufferUtils.EMPTY_DATA_BUFFER) { - FizzServerHttpRequestDecorator requestDecorator = new FizzServerHttpRequestDecorator(req); try { requestDecorator.setBody(body); } finally { NettyDataBufferUtils.release(body); } requestDecorator.getHeaders().remove(HttpHeaders.CONTENT_LENGTH); - newExchange = exchange.mutate().request(requestDecorator).build(); - if (log.isDebugEnabled()) { - log.debug("retain body", LogService.BIZ_ID, req.getId()); - } + } + ServerWebExchange mutatedExchange = exchange.mutate().request(requestDecorator).build(); + ServerWebExchange newExchange = mutatedExchange; + MediaType contentType = req.getHeaders().getContentType(); + if (MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType)) { + newExchange = new FizzServerWebExchangeDecorator(mutatedExchange); + } + if (log.isDebugEnabled()) { + log.debug(req.getId() + " request is decorated", LogService.BIZ_ID, req.getId()); } return FizzPluginFilterChain.next(newExchange); } From 017d5360d5d1d62b3d82ef09d9cd03e7d92dc6ea Mon Sep 17 00:00:00 2001 From: hongqiaowei Date: Fri, 17 Sep 2021 21:16:36 +0800 Subject: [PATCH 5/6] Add setFormData to FizzServerWebExchangeDecorator --- .../ext/FizzServerHttpRequestDecorator.java | 4 ++ .../ext/FizzServerWebExchangeDecorator.java | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/fizz-common/src/main/java/we/spring/http/server/reactive/ext/FizzServerHttpRequestDecorator.java b/fizz-common/src/main/java/we/spring/http/server/reactive/ext/FizzServerHttpRequestDecorator.java index 3c46cdc..3ccba00 100644 --- a/fizz-common/src/main/java/we/spring/http/server/reactive/ext/FizzServerHttpRequestDecorator.java +++ b/fizz-common/src/main/java/we/spring/http/server/reactive/ext/FizzServerHttpRequestDecorator.java @@ -48,6 +48,10 @@ public class FizzServerHttpRequestDecorator extends ServerHttpRequestDecorator { return headers; } + public void setEmptyBody() { + this.body = Flux.empty(); + } + public void setBody(DataBuffer body) { if (body instanceof PooledDataBuffer) { byte[] bytes = new byte[body.readableByteCount()]; diff --git a/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java b/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java index 831cc55..596fe07 100644 --- a/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java +++ b/fizz-common/src/main/java/we/spring/web/server/ext/FizzServerWebExchangeDecorator.java @@ -27,13 +27,20 @@ import org.springframework.util.StringUtils; import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchangeDecorator; import reactor.core.publisher.Mono; +import we.spring.http.server.reactive.ext.FizzServerHttpRequestDecorator; +import we.util.Constants; import we.util.NettyDataBufferUtils; +import we.util.ThreadContext; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import java.net.URLEncoder; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author hongqiaowei @@ -100,4 +107,44 @@ public class FizzServerWebExchangeDecorator extends ServerWebExchangeDecorator { return EMPTY_FORM_DATA_MONO; } } + + /** + * @param dataMap can be {@link org.springframework.util.LinkedMultiValueMap} + */ + public void setFormData(MultiValueMap dataMap) { + FizzServerHttpRequestDecorator req = (FizzServerHttpRequestDecorator) getDelegate().getRequest(); + req.getHeaders().setContentType(MediaType.APPLICATION_FORM_URLENCODED); + if (CollectionUtils.isEmpty(dataMap)) { + req.setEmptyBody(); + return; + } + StringBuilder b = ThreadContext.getStringBuilder(); + Set>> fieldValuesEntries = dataMap.entrySet(); + int fs = fieldValuesEntries.size(), cnt = 0; + try { + for (Map.Entry> fieldValuesEntry : fieldValuesEntries) { + String field = fieldValuesEntry.getKey(); + List values = fieldValuesEntry.getValue(); + if (CollectionUtils.isEmpty(values)) { + b.append(URLEncoder.encode(field, Constants.Charset.UTF8)); + } else { + int vs = values.size(); + for (int i = 0; i < vs; ) { + b.append(URLEncoder.encode(field, Constants.Charset.UTF8)) + .append('=') + .append(URLEncoder.encode(values.get(i), Constants.Charset.UTF8)); + if ((++i) != vs) { + b.append('&'); + } + } + } + if ((++cnt) != fs) { + b.append('&'); + } + } + } catch (UnsupportedEncodingException ex) { + throw new IllegalStateException(ex); + } + req.setBody(b.toString()); + } } From f0d197a4c93de551ff9659007b68e3456aaddbc4 Mon Sep 17 00:00:00 2001 From: hongqiaowei Date: Sat, 18 Sep 2021 10:44:36 +0800 Subject: [PATCH 6/6] Deprecate some method of WebUtils.java --- fizz-core/src/main/java/we/util/WebUtils.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fizz-core/src/main/java/we/util/WebUtils.java b/fizz-core/src/main/java/we/util/WebUtils.java index bab4718..d53a6d2 100644 --- a/fizz-core/src/main/java/we/util/WebUtils.java +++ b/fizz-core/src/main/java/we/util/WebUtils.java @@ -187,18 +187,22 @@ public abstract class WebUtils { return exchange.getAttribute(WebUtils.directResponse); } + @Deprecated public static Map getFilterContext(ServerWebExchange exchange) { return exchange.getAttribute(FILTER_CONTEXT); } + @Deprecated public static FilterResult getFilterResult(ServerWebExchange exchange, String filter) { return getFilterContext(exchange).get(filter); } + @Deprecated public static Map getFilterResultData(ServerWebExchange exchange, String filter) { return getFilterResult(exchange, filter).data; } + @Deprecated public static Object getFilterResultDataItem(ServerWebExchange exchange, String filter, String key) { return getFilterResultData(exchange, filter).get(key); } @@ -207,6 +211,7 @@ public abstract class WebUtils { return buildDirectResponse(exchange.getResponse(), status, headers, bodyContent); } + @Deprecated public static Mono buildDirectResponseAndBindContext(ServerWebExchange exchange, HttpStatus status, HttpHeaders headers, String bodyContent) { Mono mv = buildDirectResponse(exchange, status, headers, bodyContent); exchange.getAttributes().put(WebUtils.directResponse, mv); @@ -221,6 +226,7 @@ public abstract class WebUtils { return buildDirectResponse(exchange, status, headers, json); } + @Deprecated public static Mono buildJsonDirectResponseAndBindContext(ServerWebExchange exchange, HttpStatus status, HttpHeaders headers, String json) { if (headers == null) { headers = new HttpHeaders(); @@ -251,21 +257,25 @@ public abstract class WebUtils { .writeWith(Mono.just(clientResp.bufferFactory().wrap(bodyContent.getBytes()))); } + @Deprecated public static void transmitSuccessFilterResult(ServerWebExchange exchange, String filter, Map data) { FilterResult fr = FilterResult.SUCCESS_WITH(filter, data); bind(exchange, filter, fr); } + @Deprecated public static Mono transmitSuccessFilterResultAndEmptyMono(ServerWebExchange exchange, String filter, Map data) { transmitSuccessFilterResult(exchange, filter, data); return Mono.empty(); } + @Deprecated public static void transmitFailFilterResult(ServerWebExchange exchange, String filter) { FilterResult fr = FilterResult.FAIL(filter); bind(exchange, filter, fr); } + @Deprecated public static void transmitFailFilterResult(ServerWebExchange exchange, String filter, Throwable cause) { FilterResult fr = FilterResult.FAIL_WITH(filter, cause); bind(exchange, filter, fr); @@ -277,6 +287,7 @@ public abstract class WebUtils { fc.put(PREV_FILTER_RESULT, fr); } + @Deprecated public static FilterResult getPrevFilterResult(ServerWebExchange exchange) { return getFilterContext(exchange).get(PREV_FILTER_RESULT); } @@ -492,10 +503,12 @@ public abstract class WebUtils { } } + @Deprecated public static Mono responseErrorAndBindContext(ServerWebExchange exchange, String filter, int code, String msg) { return responseError(exchange, filter, code, msg, null, true); } + @Deprecated public static Mono responseErrorAndBindContext(ServerWebExchange exchange, String filter, int code, String msg, Throwable t) { return responseError(exchange, filter, code, msg, t, true); } @@ -508,6 +521,7 @@ public abstract class WebUtils { return responseError(exchange, reporter, code, msg, t, false); } + @Deprecated public static Mono responseErrorAndBindContext(ServerWebExchange exchange, String filter, HttpStatus httpStatus) { ServerHttpResponse response = exchange.getResponse(); String rid = exchange.getRequest().getId(); @@ -520,6 +534,7 @@ public abstract class WebUtils { return buildDirectResponseAndBindContext(exchange, httpStatus, new HttpHeaders(), Constants.Symbol.EMPTY); } + @Deprecated public static Mono responseErrorAndBindContext(ServerWebExchange exchange, String filter, HttpStatus httpStatus, HttpHeaders headers, String content) { ServerHttpResponse response = exchange.getResponse();