Ich verwende:
Java: 17 < /li>
Springboot: 3.2.0 < /li>
< /ul>
Ich verwende einen Microservice, der Anforderungen an andere Microservices (alle in Java) filtert, aber ich bin mir nicht sicher, ob ich Filterung verwende, da die Anforderung einen Fehler in dieser Anwendung markiert.
Hauptklasse: < /p>
Code: Select all
public static void main(String[] args) {
new SpringApplicationBuilder(mainClass.class)
.web(WebApplicationType.REACTIVE)
.run(args);
}
@Bean
public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
return builder.routes()
.route("service1",
r
-> r.path("/service1/**")
.filters(f -> f.stripPrefix(3))
.uri("lb://service-1"))
.route("service2",
r
-> r.path("/service2/**")
.filters(f -> f.stripPrefix(3))
.uri("lb://service-2"))
.build();
}
< /code>
Application.yml
#################################################
### Settings ###
#################################################
# Application and Active Profile
spring:
mvc:
hiddenmethod:
filter:
enabled: true
application:
name: gateway
profiles:
active: dev
servlet:
multipart:
max-file-size: 20MB
max-request-size: 20MB
enabled: true
---
spring:
cloud:
gateway:
default-filters:
- DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
- AddResponseHeader=Access-Control-Allow-Origin, *
httpclient:
connect-timeout: 25000
response-timeout: 25000
globalcors:
corsConfigurations:
"[/**]":
allowedOrigins:
- "https://localhost:4200"
allowedHeaders: "*"
allowedMethods:
- GET
- POST
- OPTIONS
- PUT
- DELETE
maxAge: 18000
allowCredentials: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 1200000
strategy: THREAD
unter org.apache.commons.FileUpload.FileUploadbase.parsequest (FileUpload> Base.java:380)
bei [internen Klassen] < /p>
< /blockquote>
Ich möchte die Datei korrekt hochladen, ohne den Multipart -Fehler zu erhalten. Vielen Dank für die Informationen, die Sie bereitstellen können. https://github.com/spring-projects/spri ... sues/18644