基于springCloud gateway请求包含url包含{}大括号特殊字符的问题

众所周知,springCloud gateway用的是异步请求方式,即webflux。

当拦截请求时,如url包含大括号“{}”特殊字符时,会报Failed to get request URI: xxx 异常。

此时需要正确请求访问,需要重写源码中相应方法:

package org.springframework.http.server.reactive;

import io.netty.channel.ChannelPipeline;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.cookie.Cookie;
import io.netty.handler.ssl.SslHandler;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Iterator;
import java.util.Set;
import javax.net.ssl.SSLSession;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.NettyDataBufferFactory;
import org.springframework.http.HttpCookie;
import org.springframework.http.HttpHeaders;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.LinkedMultiValueMap;
import org.springf

版权声明:本文为y6300023290原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。