Repository navigation
fix(unity): send Secure cookies only over HTTPS - #2141
Merged
Merged
Conversation
🟢 Tier S · Ready to mergeThis change adds URI-aware cookie selection so Secure cookies are included only for HTTPS requests, while keeping the legacy host/path overloads available. It also adds portable NUnit coverage and extends the Unity integration test to verify Secure-cookie rejection over HTTP.
📂 Walkthrough · 9
Reviewed |
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.
Unity’s managed cookie container selects cookies using only the host and path. A cookie marked
Securecan therefore be attached to an HTTP request, including whenselfSignedis enabled.The client now passes the full request URI. Secure cookies are selected only for HTTPS; ordinary cookies keep their current HTTP/HTTPS behavior. HTTP filtering retains Secure cookies for future HTTPS requests. Existing host/path overloads remain available and conservatively omit Secure cookies because they cannot establish the transport; callers needing Secure cookies should use the new URI overloads.
Validation:
CookieContainerdirectly: scheme/port combinations, legacy calls, retention, persistence, domain/path/expiry, and invalid URIs. The portable harness adapts Unity storage/logging and JSON settings; it does not replace cookie-selection logic. The Unity validation job now runs it without an editor license.ordinary=plain; session=synthetic-secretwhere only the ordinary cookie should be selected.result.txt.Native Unity execution could not run locally: the installed editor has no valid headless license. The repository already disables its Unity editor CI job for the same licensing limitation. The portable tests pass; the native integration assertions are included for execution when licensing is restored.
Tracked in appwrite-labs/cloud#6887. Cookie-value logging and broader hardening remain in the separately owned #2131.