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.
We use SGIDs in some URLs sent via email from Basecamp. Since Basecamp 3’s launch, we’ve heard reports of broken links in emails from customers whose mail clients decode slashes in URL-encoded SGIDs.
For example, errant mail clients turn an SGID such as (a) below, which Rails parses as one path segment, into (b), which Rails parses as two path segments.
Unfortunately, we’ve been unable to identify exactly which mail clients mangle SGIDs in this way.
Global ID already ensures unsigned GIDs are safe for use in URLs. To circumvent problematic mail clients, it can do the same for signed GIDs. This PR implements a custom message verifier that prefers URL-safe base64 encoding,
GlobalID::Verifier
, and makes it the default for SGID generation.GlobalID::Verifier
accepts SGIDs generated withActiveSupport::MessageVerifier
for backwards compatibility./cc @jeremy