535 Fix download data redirect#534
Open
martinherrerias wants to merge 9 commits into
Open
Conversation
WEBSAVE struggles with the chain 301 -> 308 -> 302 required for some OSF paths.
- Refactor into subfunctions to enable unit testing - Expose 'attempts' and 'timeout' parameters (apply to all methods) - Lint, document
This was referenced May 11, 2026
mathieuboudreau
self-requested a review
May 12, 2026 14:48
mathieuboudreau
approved these changes
May 12, 2026
mathieuboudreau
left a comment
Member
There was a problem hiding this comment.
Tested the feature on a Mac and it works as expected - I don't have a windows to test it on so I'll take your word that it works on your end @martinherrerias !
I did a few minor edits @martinherrerias , you can have a quick look, but overall looks good to me! Thank you!
Collaborator
Author
|
Changes look good, sorry about those typos. I fixed one more that was making the tests fail, I say it's ready to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
#535: Matlab's
websaveseems to struggle with the redirect chain 301 → 308 → 302 required for some OSF paths (e.g. mp2rage). So the same link that works on UNIX (withcurl -L) currently fails on Windows.(local-branch version of #528)
Approach
Added a fifth download option to
downloadDatathat sends repeatedmatlab.net.httprequests and tries to follow the response "Location" header.I've then refactored the whole function so that it can be unit-tested, and added tests for all methods.
Open Questions and Pre-Merge TODOs
Use github checklists. When solved, check the box and explain the answer.
Review that changed source files/lines are related to the pull request/issue
If any files/commits were accidentally included, cherry-pick them into another branch.
Review that changed source files/lines were not accidentally deleted
Fix appropriately if so.
Test new features or bug fix
If not implemented/resolved adequately, solve it or inform the developer by requesting changes in your review.
Preferably, set breakpoints in the locations that the code was changed and follow allong line by line to see if the code behaves as intended.
Manual GUI tests (general)
Specifications