Skip to content

Support {/...} patterns in UriComponents(Builder) - #759

Closed
poutsma wants to merge 1 commit into
spring-projects:masterfrom
poutsma:SPR-12750
Closed

poutsma wants to merge 1 commit into
spring-projects:masterfrom
poutsma:SPR-12750

Conversation

@poutsma

@poutsma poutsma commented Mar 20, 2015

Copy link
Copy Markdown
Contributor

This commit introduces support for "Path Segment URI Variable
expansion", see https://tools.ietf.org/html/rfc6570#section-3.2.6.
In practice, this means that URI template variables prefixed with a '/'
are treated like path segments and - as such - will encode any '/'
found. For example: {/foo} expanded with "bar/baz" with result in
"bar%2F".

Issue: SPR-12750

@rstoyanchev

Copy link
Copy Markdown
Contributor

I've gone for a slightly different approach, essentially detecting {/var} syntax at the point when path(String) is added to the builder, splitting it up, and translating to a sequence of path and path segments.

@rstoyanchev

Copy link
Copy Markdown
Contributor

Actually I've realized what I did isn't going to work for all cases. Re-opening..

This commit introduces support for "Path Segment URI Variable
expansion", see https://tools.ietf.org/html/rfc6570#section-3.2.6.
In practice, this means that URI template variables prefixed with a '/'
are treated like path segments and - as such - will encode any '/'
found. For example: {/foo} expanded with "bar/baz" with result in
"bar%2F".

Issue: SPR-12750
@poutsma

poutsma commented Mar 27, 2015

Copy link
Copy Markdown
Contributor Author

@rstoyanchev I've updated this PR with a new approach. Please take a look.

@rstoyanchev

Copy link
Copy Markdown
Contributor

Looks good, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants