Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.3.0
    • Component/s: Core
    • Labels:

      Description

      In org.springframework.ws.transport.http.HttpUrlConnection we find the following code:

      @Override
      	public Iterator<String> getResponseHeaders(String name) throws IOException {
      		Map<String, List<String>> mapHeader = connection.getHeaderFields();
      		List<String> listHeaderValues = mapHeader.get(name);
      		if (listHeaderValues == null) {
      		    return Collections.<String>emptyList().iterator();
      		} else {
      		    return listHeaderValues.iterator();
      		}
      	}
      

      This code returns an Iterator containing the HTTP-Header(s) that matches the parameter "name" . The problem is that this is case sensitive. According to the RFC HTTP-Headers are case-insensitive

        Activity

        oddgeir.gitlestad@gmail.com Oddgeir Gitlestad created issue -
        gregturn Greg Turnquist made changes -
        Field Original Value New Value
        Assignee Greg Turnquist [ gregturn ]
        gregturn Greg Turnquist made changes -
        Fix Version/s 2.3 [ 14957 ]
        Hide
        gregturn Greg Turnquist added a comment -

        Great point. What I'm wrestling with is that the interface for this API governs response header handling for not only HTTP, but also JMS, Mail, and XMPP. Do those implementations have the same case insensitivity?

        Show
        gregturn Greg Turnquist added a comment - Great point. What I'm wrestling with is that the interface for this API governs response header handling for not only HTTP, but also JMS, Mail, and XMPP. Do those implementations have the same case insensitivity?
        gregturn Greg Turnquist made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        gregturn Greg Turnquist made changes -
        gregturn Greg Turnquist made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Complete [ 8 ]
        gregturn Greg Turnquist made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        gregturn Greg Turnquist added a comment - - edited

        Sorry. I resolved the wrong issue. Reopened.

        Show
        gregturn Greg Turnquist added a comment - - edited Sorry. I resolved the wrong issue. Reopened.
        gregturn Greg Turnquist made changes -
        Resolution Complete [ 8 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        gregturn Greg Turnquist made changes -
        Hide
        oddgeir.gitlestad@gmail.com Oddgeir Gitlestad added a comment -

        I'm not sure about the other protocols. A quick google search gave me nothing. But this method is overridden so if you can fix it there it should not affect the others right?

        Show
        oddgeir.gitlestad@gmail.com Oddgeir Gitlestad added a comment - I'm not sure about the other protocols. A quick google search gave me nothing. But this method is overridden so if you can fix it there it should not affect the others right?
        Hide
        gregturn Greg Turnquist added a comment -

        True. It might take a bit of work to actually craft a unit test.

        Show
        gregturn Greg Turnquist added a comment - True. It might take a bit of work to actually craft a unit test.
        Hide
        oddgeir.gitlestad@gmail.com Oddgeir Gitlestad added a comment -

        I started looking at it. If i change the content type header in MyServlet in AbstractHttpWebServiceMessageSenderIntegrationTestCase the testSendAndReceiveFault test fails. This is good since what I'm experiencing is that i don't get access to the fault when the header has a different case than Content-Type. I will write a fix for this but what i wonder is if this is enough test coverage or should i write a separate test case for header case sensitivity?

        Show
        oddgeir.gitlestad@gmail.com Oddgeir Gitlestad added a comment - I started looking at it. If i change the content type header in MyServlet in AbstractHttpWebServiceMessageSenderIntegrationTestCase the testSendAndReceiveFault test fails. This is good since what I'm experiencing is that i don't get access to the fault when the header has a different case than Content-Type. I will write a fix for this but what i wonder is if this is enough test coverage or should i write a separate test case for header case sensitivity?
        Hide
        oddgeir.gitlestad@gmail.com Oddgeir Gitlestad added a comment -

        I created a pull request for this: https://github.com/spring-projects/spring-ws/pull/65

        Show
        oddgeir.gitlestad@gmail.com Oddgeir Gitlestad added a comment - I created a pull request for this: https://github.com/spring-projects/spring-ws/pull/65
        gregturn Greg Turnquist made changes -
        Status Reopened [ 4 ] In Progress [ 3 ]
        gregturn Greg Turnquist made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Complete [ 8 ]
        gregturn Greg Turnquist made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        7h 48m 1 Greg Turnquist 14/Mar/16 5:05 PM
        Closed Closed Reopened Reopened
        16s 1 Greg Turnquist 14/Mar/16 5:06 PM
        Reopened Reopened In Progress In Progress
        21d 9h 20m 1 Greg Turnquist 05/Apr/16 2:27 AM
        In Progress In Progress Resolved Resolved
        3m 59s 2 Greg Turnquist 05/Apr/16 2:30 AM
        Resolved Resolved Closed Closed
        11s 2 Greg Turnquist 05/Apr/16 2:30 AM

          People

          • Assignee:
            gregturn Greg Turnquist
            Reporter:
            oddgeir.gitlestad@gmail.com Oddgeir Gitlestad
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: