johnpapa / johnpapa/lite-server

A '.' in query param path gives "Cannot GET /" error

Open
#101 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.3k
Forks
262
PR merge metrics
No merged PRs in 30d

Description

### A '.' in query param path gives "Cannot GET /" error

Here is the URL that I am trying to launch:
http://localhost:8080/login;state=%2Fshare-your-cart%2Fwelcome;access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyIkX18iOnsic3RyaWN0TW9kZSI6dHJ1ZSwiZ2V0dGVycyI6e30sIl9pZCI6IjU3Y2IwOTc3YjBiZjAxMTg1NDRiOWU1YiIsIndhc1BvcHVsYXRlZCI6ZmFsc2UsImFjdGl2ZVBhdGhzIjp7InBhdGhzIjp7ImNyZWF0ZWRPbiI6ImluaXQiLCJfX3YiOiJpbml0IiwidXNlck5hbWUiOiJpbml0IiwiZmFjZWJvb2tfcGFnZSI6ImluaXQiLCJnZW5kZXIiOiJpbml0IiwiZW1haWwiOiJpbml0IiwiX2lkIjoiaW5pdCJ9LCJzdGF0ZXMiOnsiaWdub3JlIjp7fSwiZGVmYXVsdCI6e30sImluaXQiOnsiX192Ijp0cnVlLCJjcmVhdGVkT24iOnRydWUsInVzZXJOYW1lIjp0cnVlLCJmYWNlYm9va19wYWdlIjp0cnVlLCJnZW5kZXIiOnRydWUsImVtYWlsIjp0cnVlLCJfaWQiOnRydWV9LCJtb2RpZnkiOnt9LCJyZXF1aXJlIjp7fX0sInN0YXRlTmFtZXMiOlsicmVxdWlyZSIsIm1vZGlmeSIsImluaXQiLCJkZWZhdWx0IiwiaWdub3JlIl19LCJlbWl0dGVyIjp7ImRvbWFpbiI6bnVsbCwiX2V2ZW50cyI6e30sIl9ldmVudHNDb3VudCI6MCwiX21heExpc3RlbmVycyI6MH19LCJpc05ldyI6ZmFsc2UsIl9kb2MiOnsiY3JlYXRlZE9uIjoiMjAxNi0wOS0wM1QxNzozMzo0My42MTdaIiwiX192IjowLCJ1c2VyTmFtZSI6IlNhbmNoaXQgS2hhdHRyeSIsImZhY2Vib29rX3BhZ2UiOiJodHRwczovL3d3dy5mYWNlYm9vay5jb20vYXBwX3Njb3BlZF91c2VyX2lkLzEwNTkyMTgyMjc0NjY0MTAvIiwiZ2VuZGVyIjoibWFsZSIsImVtYWlsIjoic2FuY2hpdDAzMDM5MUBob3RtYWlsLmNvbSIsIl9pZCI6IjU3Y2IwOTc3YjBiZjAxMTg1NDRiOWU1YiJ9LCJfcHJlcyI6eyIkX19vcmlnaW5hbF9zYXZlIjpbbnVsbCxudWxsXSwiJF9fb3JpZ2luYWxfdmFsaWRhdGUiOltudWxsXSwiJF9fb3JpZ2luYWxfcmVtb3ZlIjpbbnVsbF19LCJfcG9zdHMiOnsiJF9fb3JpZ2luYWxfc2F2ZSI6W10sIiRfX29yaWdpbmFsX3ZhbGlkYXRlIjpbXSwiJF9fb3JpZ2luYWxfcmVtb3ZlIjpbXX0sImlhdCI6MTQ3MzQ4MTM5MiwiZXhwIjoxNDczNDg0OTkyfQ.DojhbHAWh2Uh4hCCTVKqYQguxvhqRGrVXbr_9uV_m_Q#_=_

In the above URL the access token field has a dot character (at certain places) along with other characters and that is causing the error. If I replace the dot with something else the URL works fine.
### Bug repro steps

Please give us an isolated way to reproduce the behavior (example: GitHub repository with code that anyone can clone to observe the problem, or a Dockerfile that replicates your environment):
1. Create a route in your SPA with query parameters
2. Have one of the parameters contain a '.' character
3. You'll see "Cannot GET /" error.
### Environment
- `lite-server` version: 2.2.2
- OS type/version: Windows 10

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.