Allow attachment chat GUID via query fallback - #830
Draft
yym8224961 wants to merge 1 commit into
Draft
Conversation
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.
What changed
Allow
POST /api/v1/message/attachmentto use a stringchatGuidquery parameter when the multipart body omits the field or contains a semicolon-truncated prefix of the query value.The existing multipart body remains authoritative for complete or conflicting values. The query parameter is copied into the request body before the existing attachment validation runs, so the same
required|stringvalidation and downstream routing continue to apply.Why
Addresses the workaround requested in #804. The truncation is reproducible before the request reaches BlueBubbles: curl's
-Fparser treats semicolons as form-field option delimiters, so-F 'chatGuid=iMessage;-;+15551234567'sends onlyiMessage.--form-stringsends the full value, but accepting the query parameter provides a backwards-compatible path for affected clients.Example query value:
chatGuid=iMessage%3B-%3B%2B15551234567. The+is encoded as%2Bso query parsing does not turn it into a space.Impact
chatGuidare unchanged.chatGuidnow passes through the existing validator.chatGuidcan repair a body value that is its semicolon-truncated prefix.Validation
-Ftruncation against an independent HTTP echo endpoint.curl --form-stringpreserves the full GUID.git diff --check.A macOS/iMessage end-to-end test was not available in this environment.