Skip to content

MockHttpServletRequest with Host: set builds wrong getRequestURL() [SPR-16138] #20686

Closed

Description

@spring-projects-issues

Steven Schlansker opened SPR-16138 and commented

MockHttpServletRequest has a serverName field, but the getter does additional logic around parsing the Host: header. This leads to inconsistency when getRequestURL reflects a different serverName than getServerName does.

#1579


Affects: 4.3.12

Issue Links:

Referenced from: commits 9ca4de1, 0edf4d6

Backported to: 4.3.13

Activity

  1. spring-projects-issues commented on Oct 31, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    Good point... I guess the same applies to getServerPort() as well?

  2. spring-projects-issues commented on Nov 5, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    I've addressed this as part of a larger revision along with #20708, also covering the server port case.

  3. added
    type: bug
    in: test
    status: backported
    on Jan 11, 2019
  4. added this to the 5.0.2 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: teststatus: backportedtype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions