spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Unexpected changes to query string

Open fredliex opened this issue 2 years ago • 1 comments

Describe the bug I use gateway mvc to reverse proxy vite. ProxyExchangeHandlerFunction changes the query string part of the url, causing vite to reply with different response.

Sample originally http://localhost:5174/src/components/HelloWorld.vue?scoped=e17ea971&index=0&type=style&vue=&lang.css change to http://localhost:5174/src/components/HelloWorld.vue?scoped=e17ea971&index=0&type=style&vue=&lang.css= There is an extra '=' character at the end.

It all seems to be in ProxyExchangeHandlerFunction.handle caused by UriComponentsBuilder.replaceQueryParams.

fredliex avatar Dec 26 '23 08:12 fredliex

SCG consider lang.css as a url parameter, and its value is empty. Use stripPrefix or custum filter to remove the redundant char.

kimmking avatar Jan 14 '24 17:01 kimmking