Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two consequent slashes are escaped #867

Open
dmak opened this issue May 29, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@dmak
Copy link

commented May 29, 2017

If I interpret RCF3986 correctly, the standard allows empty path segments in URL:

path-absolute = "/" [ segment-nz *( "/" segment ) ]
segment-nz    = 1*pchar
segment       = *pchar

However RESTAssured escapes slashes in the following case:

given().when().get("/family//info")...

Above results URL:

/family%2F%2Finfo

Expected:

/family//info

RESTAssured v3.0.1.

Workaround: Disable URL encoding via given().urlEncodingEnabled(false)...

@johanhaleby

This comment has been minimized.

Copy link
Collaborator

commented May 30, 2017

Thanks for pointing out.

@underdo

This comment has been minimized.

Copy link

commented Jun 7, 2017

Relates to this issue. Sub-delims characters are escaped in a path segment.

According to RFC 3986 Sections 2.2 and 3.3

sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="
...
      path-abempty  = *( "/" segment )
      path-absolute = "/" [ segment-nz *( "/" segment ) ]
...
      segment       = *pchar
      segment-nz    = 1*pchar
...
      pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"

In REST Assured 3.0.3
given().when().get("/service/any/one,two,three")...
Actual path
/service/any/one%2Ctwo%2Cthree
Expected path
/service/any/one,two,three

Aforementioned workaround is applicable here as well.

@johanhaleby

This comment has been minimized.

Copy link
Collaborator

commented Jun 7, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.