Spring integration Spring集成:通过自定义http头转换为小写
我的应用程序应该通过自定义http头,因此我告诉入站http网关将该头映射为请求和响应头:Spring integration Spring集成:通过自定义http头转换为小写,spring-integration,Spring Integration,我的应用程序应该通过自定义http头,因此我告诉入站http网关将该头映射为请求和响应头: @Bean public IntegrationFlow myFlow() { return IntegrationFlows .from(Http.inboundGateway("/myresource/{transactionId}") .mappedRequestHeaders("X-My-Header", HTTP_REQUES
@Bean
public IntegrationFlow myFlow() {
return IntegrationFlows
.from(Http.inboundGateway("/myresource/{transactionId}")
.mappedRequestHeaders("X-My-Header",
HTTP_REQUEST_HEADER_NAME_PATTERN)
.mappedResponseHeaders("X-My-Header",
HTTP_RESPONSE_HEADER_NAME_PATTERN)
...
标题可以通过,但它被转换为小写,即我在响应中找到x-my-header。我知道http头是不区分大小写的,但我还是希望保持头的原始形式。这可能吗?根据HTTP RFC头不区分大小写,因此必须更改应用程序中的逻辑以忽略这些名称的大小写 Tomcat团队建议实现一个定制的
过滤器
,以覆盖响应头:
无论如何,我会重新考虑客户端应用程序逻辑不处理的情况。但与Spring集成无关