Я использую:
Springboot: 3.2.0 < /li>
< /ul>
Я использую микросервис, который фильтрует запросы на другие микросервисы (все в Java), но я не уверен, что это потому, что я использую фильтрацию, потому что запрос отмечает ошибку в этом приложении. /> Основной класс: < /p>
Код: Выделить всё
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
Caused by: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:380)
at [internal classes]
< /code>
Я хотел бы правильно загрузить файл, не получая ошибку Multipart. Спасибо за информацию, которую вы можете предоставить. https://github.com/spring-projects/spri ... ues/186444
Подробнее здесь: https://stackoverflow.com/questions/794 ... et-request