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

V5 - Add slash to paths that need them in serve #252

Merged
merged 2 commits into from
Mar 21, 2019

Conversation

agubler
Copy link
Member

@agubler agubler commented Mar 7, 2019

Type: bug

Description:
In serve mode, if serve-static can't resolve a file it sends a 301 redirect with an additional slash. This causes problems with relative paths on the page afterwards.

Rather than having this behaviour, instead opt to add the slash before resolving in serve-static.

Backport of #247 & #253

* add slash to paths that need them

* only rewrite on html type requests

* fix test
@agubler agubler changed the title Add slash to paths that need them in serve V5 - Add slash to paths that need them in serve Mar 7, 2019
* change to using req.accepts

* package-lock
@agubler
Copy link
Member Author

agubler commented Mar 8, 2019

@matt-gadd I've updated this back port with the latest pull request

@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #252 into v5 will decrease coverage by 0.26%.
The diff coverage is 20%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v5     #252      +/-   ##
==========================================
- Coverage   52.43%   52.17%   -0.27%     
==========================================
  Files          10       10              
  Lines         616      621       +5     
  Branches      155      156       +1     
==========================================
+ Hits          323      324       +1     
- Misses        293      297       +4
Impacted Files Coverage Δ
src/main.ts 88.63% <20%> (-2.01%) ⬇️

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 911916d...de90981. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants