Skip to content
Advertisement

Tag: spring-cloud-gateway

No ‘Access-Control-Allow-Origin’ header is present (CORS) – Spring Boot (Spring security) Microservices + Vue.js

I’m working on Spring Boot project based on microservices architecture on backend and Vue.js on frontend. Structure of my project is next: For avoiding CORS error usually I add @CrossOrigin annotation on to class and it works. It was all good and has been working well, until I added security part with ability to login users. What did I did:

Spring Cloud Gateway – How To Modify Response Body In Post Filter

So far, I’ve not seen any solutions that is working for me. I’ve tried this and this. Here is my custom filter: The ModifyResponseBodyGatewayFilterFactory works if I implement it in a pre-filter, but how do I modify it in the post-filter. Answer To answer the question about modifying the response in post-filter. Firstly, need to understand the pre and post

Spring Cloud Gateway Route URL pattern configuration

I’m have implemented Spring Cloud Gateway with Eureka discovery service, everything works fine but I have seen something that I don’t know how to deal with when I write the URL and if I don’t put a / at the end of the URL the gateway redirects to the app directly using its actual URL (registered in Eureka). For example:

@Order in AbstractNameValueGatewayFilterFactory doesn’t work

I have 2 classes: filter and class to get response body. As far as I know I need to specify order NettyWriteResponseFilter.WRITE_RESPONSE_FILTER_ORDER-1 so filter will get response body. But when I implement Ordered or use annotation @Order or via OrderedGatewayFilter I cann’t call BodyRewrite class(which gets response body). When I try to use this for global filter(implemented GlobalFilter) it works

Route order in Spring Cloud Gateway

We are implementing routes programmatically using a implementation of RouteDefinitionLocator. We have two services which should register at the same route path, where one of them is meant as a fallback if the other one does not exist. The preferred route with the specific path is: And the more general one, which should only fire if other route was found:

Advertisement