Skip to content

Commit

Permalink
HTTPCORE-763: remove checks that assert a path does not start with "//"
Browse files Browse the repository at this point in the history
  • Loading branch information
turing85 authored and ok2c committed Jan 16, 2024
1 parent d39031d commit 2662231
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ public String getPath() {

@Override
public void setPath(final String path) {
if (path != null) {
Args.check(!path.startsWith("//"), "URI path begins with multiple slashes");
}
this.path = path;
this.requestUri = null;
}
Expand Down Expand Up @@ -278,7 +275,6 @@ public void setUri(final URI requestUri) {
final StringBuilder buf = new StringBuilder();
final String rawPath = requestUri.getRawPath();
if (!TextUtils.isBlank(rawPath)) {
Args.check(!rawPath.startsWith("//"), "URI path begins with multiple slashes");
buf.append(rawPath);
} else {
buf.append("/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,6 @@ public void testRequestHostWithReservedChars() throws Exception {
Assertions.assertEquals(new URI("http://%21example%21.com/stuff"), request.getUri());
}

@Test
public void testRequestPathWithMultipleLeadingSlashes() throws Exception {
Assertions.assertThrows(IllegalArgumentException.class, () ->
new BasicHttpRequest(Method.GET, URI.create("http://host//stuff")));
}

@Test
public void testRequestAbsoluteRequestUri() throws Exception {
final BasicHttpRequest request = new BasicHttpRequest(Method.GET, new HttpHost("http", "somehost", -1), "stuff");
Expand Down

0 comments on commit 2662231

Please sign in to comment.