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

Add middlware to block access to "hidden" dot-files #8

Merged
merged 2 commits into from
Nov 16, 2017
Merged

Conversation

arp242
Copy link
Contributor

@arp242 arp242 commented Nov 16, 2017

For https://github.com/Teamwork/desk/pull/2674

Also add a test for the existing path traversal middleware.

I put them both in staticMiddlware instead of making a separate
package for 'em. Seemed to make more sense to me,

For https://github.com/Teamwork/desk/pull/2674

Also add a test for the existing path traversal middleware.

I put them both in `staticMiddlware` instead of making a separate
package for 'em. Seemed to make more sense to me,
@codecov
Copy link

codecov bot commented Nov 16, 2017

Codecov Report

Merging #8 into master will increase coverage by 0.49%.
The diff coverage is 80.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
+ Coverage   78.29%   78.78%   +0.49%     
==========================================
  Files           4        5       +1     
  Lines         129      165      +36     
==========================================
+ Hits          101      130      +29     
- Misses         24       29       +5     
- Partials        4        6       +2
Impacted Files Coverage Δ
staticMiddleware/static.go 80.55% <80.55%> (ø)

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 b42adb3...bfc9366. Read the comment docs.

{"/some/./path", 200},
{"/some/path/.hidden", 404},
{"/some/path/.hidden/file", 404},
{"/.some/path/hidden/file", 404},
Copy link
Contributor

Choose a reason for hiding this comment

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

Should add a test for valid extensions just to make sure this doesn't get broken:

"/some/file.json", 200

@arp242 arp242 merged commit fef902e into master Nov 16, 2017
@arp242 arp242 deleted the block-dotfiles branch November 16, 2017 18:27
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