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

Fix scope in redirect for bad paths #119

Merged
merged 3 commits into from
Jul 24, 2018

Conversation

Ianfeather
Copy link
Contributor

I don't know why this was commented out with a fix comment. It makes me wonder if this can have some side effects that i'm not expecting. I'm going to test it out on our side.

@codecov
Copy link

codecov bot commented Jul 20, 2018

Codecov Report

Merging #119 into master will increase coverage by 0.7%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #119     +/-   ##
=========================================
+ Coverage   89.72%   90.43%   +0.7%     
=========================================
  Files          27       27             
  Lines         438      439      +1     
=========================================
+ Hits          393      397      +4     
+ Misses         45       42      -3
Impacted Files Coverage Δ
lib/routes/tarballs.js 90.62% <100%> (+9.97%) ⬆️
lib/config.js 100% <0%> (ø) ⬆️

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 e3f1917...adc31e4. Read the comment docs.

@Ianfeather
Copy link
Contributor Author

Added tests and they all pass locally.

let url = `/${name}/-/${scope2}/${sha}`
// TODO: fix scoped packages
// if (scope) url = `/${scope}${url}`
let _scope = scope ? `/${scope}` : ''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix, thanks Ian! Can we convert the let to a const as the value isn't reassigned. Also curious on the underscore naming convention. Are you denoting it's private?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just gave it an underscore because there is already a scope var. Ultimately it's still reflective of the scope so it made more sense to me to give it the underscore. I can call it something else to avoid confusion.

@Ianfeather
Copy link
Contributor Author

@dgautsch just updated it

@dgautsch dgautsch merged commit 687d72f into jdx:master Jul 24, 2018
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.

None yet

2 participants