Skip to content

An encoded slash in a path parameter is treated as a path separator #54

@kevinstembridge

Description

@kevinstembridge

The UriTemplate.extract method decodes the URI before splitting it into path parameters.

public PathParameters extract(String uri) {
    List<String> values = groupValues(templateRegex.findMatches(UrlEncodedMessage.decode(trimSlashes(uri))).head());
    return pathParameters(names.zip(values));
}

This causes any encoded slashes to be converted to slashes and treated as a path separator. I'm pretty sure it would be safe to split first and then decode each parameter individually. I cloned and tried to give it a go but repo.bodar.com:80 is blocked by the company firewall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions