Skip to content

Commit

Permalink
Merge pull request #228 from imtayadeway/squeeze-path-slashes
Browse files Browse the repository at this point in the history
Squeeze consecutive slashes in the path portion of the URI
  • Loading branch information
chrisarcand authored Jan 8, 2018
2 parents 15206e1 + a72ccb9 commit bef0a63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/api/request_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def version
end

def url
@request.original_url # http://target/api/...
@request.url # http://target/api/...
end

def prefix(version = true)
Expand Down Expand Up @@ -106,7 +106,7 @@ def expand_requested
end

def fullpath
@request.original_fullpath # /api/...&param=value...
@request.fullpath # /api/...&param=value...
end
end
end
8 changes: 8 additions & 0 deletions spec/requests/entrypoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,12 @@
)
)
end

it "will squeeze consecutive slashes in the path portion of the URI" do
api_basic_authorize

get("http://www.example.com//api")

expect(response).to have_http_status(:ok)
end
end

0 comments on commit bef0a63

Please sign in to comment.