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 wrong session validation in uploads #1438

Merged
merged 3 commits into from Feb 12, 2018

Conversation

Projects
None yet
3 participants
@vxcamiloxv
Member

vxcamiloxv commented Sep 4, 2017

app.session instance not exists

before pump 4.x session middleware was living in app instance > app.js

Closes: #1435

@strugee

Definitely a regression, really nice catch @vxcamiloxv. 23e6a97 should have fixed this but didn't.

Left some minor nits inline but overall this looks super great. Can you edit the commit messages so the first one says "Fix session middleware usage in uploads", with "app.session is no longer the session middleware as of 23e6a97" (that way we have a nice reference as to when the regression was introduced)? The second one can be shortened to "Test viewing uploads from the web interface" too.

As always thanks so much for your patience!

@@ -187,6 +188,57 @@ suite.addBatch({
assert.ifError(err);
}
},
"and we get the file from web interface without login": {

This comment has been minimized.

@strugee

strugee Jan 25, 2018

Member

"the web interface" instead of "web interface"; "logging in" instead of "login"

This comment has been minimized.

@vxcamiloxv
br.assert.status(403);
}
},
"and we login for try get file": {

This comment has been minimized.

@strugee

strugee Jan 25, 2018

Member

"and we login and try to get the file"

This comment has been minimized.

@vxcamiloxv
assert.ifError(err);
br.assert.success();
},
"and we get the file from web interface with login": {

This comment has been minimized.

@strugee

strugee Jan 25, 2018

Member

s/with login/while logged in/

This comment has been minimized.

@strugee

strugee Jan 25, 2018

Member

And add a "the" before "web interface" too.

This comment has been minimized.

@vxcamiloxv
@strugee

This comment has been minimized.

Member

strugee commented Jan 25, 2018

Also, I assume you tested the test? I.e. reverting the first commit causes the test to fail?

vxcamiloxv added some commits Sep 4, 2017

Fix session middleware usage in uploads
`app.session` is no longer the session middleware as of 23e6a97

Closes: #1435
@vxcamiloxv

This comment has been minimized.

Member

vxcamiloxv commented Feb 4, 2018

@strugee yes, if you revert the commit the test will fail

@coveralls

This comment has been minimized.

coveralls commented Feb 4, 2018

Coverage Status

Coverage increased (+0.4%) to 73.62% when pulling ffe7e31 on vxcamiloxv:fix-uploads-session into 3d393b7 on pump-io:master.

@strugee

LGTM. Thanks very much @vxcamiloxv 🎉

@strugee strugee merged commit 4a63619 into pump-io:master Feb 12, 2018

3 checks passed

Node Security No known vulnerabilities found
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.4%) to 73.62%
Details

@vxcamiloxv vxcamiloxv deleted the vxcamiloxv:fix-uploads-session branch Feb 12, 2018

@vxcamiloxv

This comment has been minimized.

Member

vxcamiloxv commented Feb 12, 2018

;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment