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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix URL parsing w/ trailing slash & querystring #1539

Merged
merged 3 commits into from Dec 6, 2019

Conversation

@scottinet
Copy link
Member

scottinet commented Dec 2, 2019

Description

Fix a bug where an URL containing both a trailing slash and a querystring would be incorrectly parsed.

How to reproduce

The following HTTP GET request works fine:

http://localhost:7512/_now?pretty

But not this one without this PR:

http://localhost:7512/_now/?pretty

Both requests are equivalent and should be regarded as identical.

Other changes

Use the WHATWG URL parsing API instead of the legacy (and deprecated) Node.js URL parser.
Unfortunately, the latter was much more adapted to URL parsing server-side than the former. 馃槕

Reverted to the legacy URL API because of:

scottinet added 2 commits Dec 2, 2019
@codecov

This comment has been minimized.

Copy link

codecov bot commented Dec 3, 2019

Codecov Report

Merging #1539 into 2-dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##            2-dev    #1539   +/-   ##
=======================================
  Coverage   93.52%   93.52%           
=======================================
  Files          98       98           
  Lines        6749     6749           
=======================================
  Hits         6312     6312           
  Misses        437      437
Impacted Files Coverage 螖
lib/core/httpRouter/routePart.js 100% <100%> (酶) 猬嗭笍
lib/core/httpRouter/index.js 98.64% <100%> (-0.04%) 猬囷笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update b6443aa...c4af16a. Read the comment docs.

@Aschen
Aschen approved these changes Dec 4, 2019
@scottinet scottinet merged commit 6e88784 into 2-dev Dec 6, 2019
10 checks passed
10 checks passed
Header rules No header rules processed
Details
Pages changed 473 new files uploaded
Details
Redirect rules No redirect rules processed
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
Mixed content No mixed content detected
Details
codecov/project 93.52% (+0%) compared to b6443aa
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
sonarqube SonarQube reported no issues
@scottinet scottinet deleted the 2/fix-trailing-slash-in-url branch Dec 6, 2019
@scottinet scottinet mentioned this pull request Dec 6, 2019
scottinet added a commit that referenced this pull request Dec 6, 2019
# [2.0.1](https://github.com/kuzzleio/kuzzle/releases/tag/2.0.1) (2019-12-06)


#### Bug fixes

- [ [#1534](#1534) ] Configured server limit were not applied to some m* and deleteByQuery routes   ([scottinet](https://github.com/scottinet))
- [ [#1539](#1539) ] Fix URL parsing w/ trailing slash & querystring   ([scottinet](https://github.com/scottinet))
- [ [#1531](#1531) ] Enforce naming rules on indexes and collections   ([scottinet](https://github.com/scottinet))
- [ [#1530](#1530) ] Rejects new API requests during a shutdown sequence   ([scottinet](https://github.com/scottinet))
- [ [#1504](#1504) ] Do not delete a profile still assigned to users   ([Yoann-Abbes](https://github.com/Yoann-Abbes))

#### Enhancements

- [ [#1533](#1533) ] Add plugin version to server info   ([Aschen](https://github.com/Aschen))
- [ [#1536](#1536) ] Prevent overloads caused by pre-funnel pipes   ([scottinet](https://github.com/scottinet))
- [ [#1543](#1543) ] Use kuzzle-plugin-auth-passport-local@6.1.0   ([scottinet](https://github.com/scottinet))
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.