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

Merged
merged 3 commits into from Feb 12, 2018

Conversation

@vxcamiloxv
Copy link
Member

@vxcamiloxv 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

Copy link
Member

@strugee strugee left a comment

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

vxcamiloxv Feb 4, 2018
Author Member

Done,

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

vxcamiloxv Feb 4, 2018
Author Member

Done.

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

vxcamiloxv Feb 4, 2018
Author Member

Done.

@strugee
Copy link
Member

@strugee strugee commented Jan 25, 2018

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

@vxcamiloxv vxcamiloxv force-pushed the vxcamiloxv:fix-uploads-session branch 3 times, most recently from 53f3e42 to d7c992b Feb 4, 2018
vxcamiloxv added 2 commits Sep 4, 2017
`app.session` is no longer the session middleware as of 23e6a97

Closes: #1435
@vxcamiloxv vxcamiloxv force-pushed the vxcamiloxv:fix-uploads-session branch from d7c992b to bd564fb Feb 4, 2018
@vxcamiloxv
Copy link
Member Author

@vxcamiloxv vxcamiloxv commented Feb 4, 2018

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

@coveralls
Copy link

@coveralls 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.

Copy link
Member

@strugee strugee left a comment

LGTM. Thanks very much @vxcamiloxv 🎉

@strugee strugee merged commit 4a63619 into pump-io:master Feb 12, 2018
3 checks passed
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
Copy link
Member Author

@vxcamiloxv vxcamiloxv commented Feb 12, 2018

;)

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

Successfully merging this pull request may close these issues.

None yet

3 participants