Skip to content

Spring:url tag should not use application/x-www-form-urlencoded encoding [SPR-6296] #10962

@spring-projects-issues

Description

@spring-projects-issues

Scott Andrews opened SPR-6296 and commented

The spring:url tag currently uses java.net.URLEncoder to URL encode template variables. URLEncoder does not follow raw URL encoding, but rather the application/x-www-form-urlencoded MIME format. This has the effect of encoding space charters as '+' instead of '%20'.

application/x-www-form-urlencoded is defined as part of the HTML spec (see http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1) and not the URL spec. While the spring:url tag is often used for HTML, it should not be assumed that the URL will be used in HTML, or with an application/x-www-form-urlencoded content type.


Affects: 3.0 RC1

Issue Links:

Referenced from: commits 67b5781

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions