Fix duplicate header issue for Swoole 6.1.6 compatibility#144
Merged
Conversation
Swoole 6.1.3+ stores duplicate HTTP headers as arrays instead of using last-value-wins. This caused issues when: 1. The SDK's addHeader() lowercases header keys (x-appwrite-project) 2. But importFile() was passing mixed-case headers (X-Appwrite-Project) 3. array_merge() kept both keys since PHP arrays are case-sensitive 4. Swoole then stored both as arrays, causing type errors Fixes: - Destinations/Appwrite.php: Remove redundant auth headers from importFile() - they're already set via setProject()/setKey() - Sources/Appwrite.php: Use lowercase header keys for consistency with the SDK's addHeader() method Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
WalkthroughTwo files in the Appwrite migration module were modified. The Destinations file had authentication headers removed from file upload requests (both single-part and multi-part upload paths). The Sources file had authentication header keys updated from mixed-case to lowercase format in the constructor and health/version API request. These changes shift authentication responsibility to Client configuration rather than per-request headers. Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
abnegate
added a commit
to appwrite/appwrite
that referenced
this pull request
Feb 5, 2026
Swoole 6.1+ stores duplicate HTTP headers as arrays instead of using last-value-wins. While the root cause (duplicate headers in the migration library) is fixed in: utopia-php/migration#144 This defensive handling is needed until that PR is merged and a new version of the migration library is released and adopted. The handling takes the first value from the array if multiple values are present, maintaining backward compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Swoole 6.1.3+ stores duplicate HTTP headers as arrays instead of using last-value-wins. This caused issues when:
Fixes:
Summary by CodeRabbit