Skip to content

Origins doesn't anticipate an Origin header with a path [SPR-13478] #18057

@spring-projects-issues

Description

@spring-projects-issues

George opened SPR-13478 and commented

  1. Transformation of the origin into uri components used to fail with a NumberFormatException when origin string contained a character after the port definition like:
    • http://domain1.org:8080/
    • http://domain1.org:80/path/file
  2. This also affected DefaultCorsProcessor.processRequest, due to WebUtils.isSameOrigin call.
  3. Origin validity check was considering http://domain1.com and http://domain1.com/ to be different. The same applies to allowed origins comparison.

Everything above doesn't comply to RFC 6454 standard:

3.2.1. Examples
All of the following resources have the same origin:
http://example.com/
http://example.com:80/
http://example.com/path/file

I'm not totally sure about UriComponentsBuilder.fromHttpRequest but based on the code it may fail the same way as UriComponentsBuilder fromOriginHeader did. It depends what value can be stored in X-Forwarded-Host.


Affects: 4.2 GA, 4.2.1

Reference URL: facebookincubator/SocketRocket#256

Referenced from: pull request #875, and commits 9c66dfa

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions