Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration Spring集成:通过自定义http头转换为小写_Spring Integration - Fatal编程技术网

Spring integration Spring集成:通过自定义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

我的应用程序应该通过自定义http头,因此我告诉入站http网关将该头映射为请求和响应头:

@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集成无关