Repository navigation
Phase 1: force BIDS filenames on data.nemar.org downloads (#513) - #515
Merged
neuromechanist merged 3 commits intoMay 16, 2026
Conversation
Annex-keyed presigned URLs now carry response-content-disposition with the BIDS basename so browsers, rclone, aria2c and curl save SHA256E-...bdf as sub-XX_task-Y_emg.bdf. RFC 6266 attachment value carries both an ASCII filename= (sanitised for the quoted-string) and an RFC 5987 filename*=UTF-8'' extension for non-ASCII names. Disposition emits with no inter-token whitespace so the value survives aws4fetch's URLSearchParams round-trip (form-encoded + vs %20) intact.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR515Version: 🤖 Updated on each push. |
Apply Phase 1 code-reviewer feedback on PR #515: explain why response-content-disposition must be URL-encoded before signing (escape ;=&# from breaking URL parsing), add a regression test for top-level annex bidsPath, and pin that response-content-disposition appears before X-Amz-Signature so a future refactor that appends after signing fails loudly.
neuromechanist
merged commit May 16, 2026
a1e0f50
into
feature/issue-514-epic-website-followups
1 check passed
4 of 7 tasks
This branch was previously deployed
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.
Closes #513. Phase 1 of epic #514.
Summary
response-content-disposition=attachment;filename="<bids-basename>"so S3 returns the BIDS-shaped filename inContent-Dispositionon the actual GET.buildContentDisposition()indata-router.tsproduces an RFC 6266 value with both an ASCIIfilename=(sanitised for quoted-string) and an RFC 5987filename*=UTF-8''...extension for Unicode names.URLSearchParamswhich form-encodes space as+, and omitting whitespace dodges the+vs%20ambiguity entirely while still being valid per RFC 6266 (OWS is optional).git:branch is unchanged:raw.githubusercontent.comalready serves with the BIDS basename because the URL path ends with it.Test plan
bun test test/data-route.unit.test.ts→ 105 pass / 0 failtsc --noEmitin backend passescurl -sIL "https://data.nemar.org/nm000104/v2.0.0/sub-01438774/ses-1625258895/emg/sub-01438774_ses-1625258895_task-typing_emg.bdf" | grep -i content-dispositionreturnsattachment;filename="sub-01438774_..._emg.bdf"rclone copy :http:data.nemar.org/nm000104/v2.0.0/ ./produces BIDS-shaped filenamesNotes
filename*; sanitiser handles quotes/backslashes/spaces; helper output has no whitespace tokens.