fix(import): preserve content-type case for multipart boundary matching#1565
Merged
hijzy merged 1 commit intoApr 28, 2026
Merged
Conversation
Previously the import endpoint lowercased the entire content-type header before parsing, which corrupted the boundary value (e.g. WebKitFormBoundaryXyZ → webkitformboundaryxyz). The body retained the original case, so the parser could not find any boundary match and returned "missing 'bundle' file field". Other improvements: - parseMultipartBundle now operates on Buffers directly (no binary encoding round-trip that could corrupt UTF-8 content) - handles boundaries with or without leading dashes in the header - adds JSON fallback when multipart parsing fails entirely - raises import body limit to 100MB so large databases can be uploaded - install.sh: explicit bridge daemon kill step with force-kill fallback
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.
Summary
Fixes "missing 'bundle' file field" error when importing JSON bundles via the viewer's Import page.
Root cause: The import endpoint lowercased the entire
content-typeheader (ct.toLowerCase()) before parsing, which corrupted the case-sensitive boundary value. For example, browsers send a header likeboundary=----WebKitFormBoundaryfCbu5kYxjTihKDLqbut the request body uses the original-caseWebKitFormBoundaryfCbu5kYxjTihKDLq. After lowercasing, no match could be found, parser returnednull, and the user saw the misleading "missing 'bundle' file field" error.Fix: Preserve the original case of the content-type header for boundary parsing; only lowercase a copy used for the type-prefix check.
Other improvements
parseMultipartBundlenow operates on Buffers directly (no binary encoding round-trip that could corrupt UTF-8 content)install.sh: explicit bridge daemon kill step with force-kill fallback for cleaner re-installsTest plan