Conversation
Validates that avatar URLs use the https: protocol. Uses the URL constructor to parse the input, which also rejects malformed URLs. Refs #237
The preview image is now only shown when the URL passes validation. This prevents rendering tracking pixels, data: URIs, and other potentially malicious content. Closes #237
When the user enters a URL that does not use https://, a red message appears below the input explaining the requirement.
The validateForm function now checks the avatar URL protocol before allowing a save. This is a defense-in-depth measure alongside the preview validation.
Replaces the plain text message with a styled placeholder that mirrors the valid preview layout, making the invalid state visually consistent.
Prevents the browser from sending a Referer header when loading the avatar image. This reduces information leakage to external image hosts.
Ensures the image request does not include cookies or credentials, further limiting the data exposed to external hosts.
Provides immediate visual feedback that the entered URL does not pass validation, consistent with how other form fields handle errors.
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.
Closes #237