fix: trim trailing slash from giteaURL when building review link #40

Merged
rodin merged 1 commits from fix/url-normalization into main 2026-05-02 18:52:14 +00:00
Owner

Prevents double-slash in supersede URL if GITEA_URL ends with /.

While browsers handle // gracefully, malformed URLs can cause issues with URL parsers, redirect checks, and security scanners.

Aligns with how gitea.NewClient already normalizes the base URL via strings.TrimRight.

Prevents double-slash in supersede URL if `GITEA_URL` ends with `/`. While browsers handle `//` gracefully, malformed URLs can cause issues with URL parsers, redirect checks, and security scanners. Aligns with how `gitea.NewClient` already normalizes the base URL via `strings.TrimRight`.
rodin added 1 commit 2026-05-02 18:49:31 +00:00
fix: trim trailing slash from giteaURL when building review link
CI / test (pull_request) Successful in 14s
CI / review (gpt-4.1, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 20s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 28s
CI / review (gpt-5, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 41s
50091941e1
Prevents double-slash in supersede URL if GITEA_URL ends with '/'.
Aligns with how gitea.NewClient already normalizes the base URL.
gpt-review-bot approved these changes 2026-05-02 18:50:05 +00:00
gpt-review-bot left a comment
First-time contributor

Gpt Review

Summary

This change trims trailing slashes from Gitea URLs in supersede links, preventing malformed URLs. It is a small but robust fix and aligns with existing normalization logic.

Recommendation

APPROVE — The update is correct, safe, and idiomatic. It prevents double slashes in the constructed URL by applying strings.TrimRight to the Gitea base URL, mirroring best practices elsewhere in the codebase. All CI checks pass and there are no issues found. Approve as is.


Review by gpt


Evaluated against 50091941

# Gpt Review ## Summary This change trims trailing slashes from Gitea URLs in supersede links, preventing malformed URLs. It is a small but robust fix and aligns with existing normalization logic. ## Recommendation **APPROVE** — The update is correct, safe, and idiomatic. It prevents double slashes in the constructed URL by applying strings.TrimRight to the Gitea base URL, mirroring best practices elsewhere in the codebase. All CI checks pass and there are no issues found. Approve as is. --- *Review by gpt* <!-- review-bot:gpt --> --- *Evaluated against 50091941*
security-review-bot approved these changes 2026-05-02 18:50:13 +00:00
security-review-bot left a comment
Collaborator

Security Review

Summary

This change safely trims a trailing slash from the Gitea base URL when composing the supersede link, preventing malformed double-slash URLs. It is a minimal, defensive improvement with no negative security impact.

Recommendation

APPROVE — CI passed and the modification aligns with best practices for URL normalization. From a security perspective, canonicalizing the URL reduces potential quirks in downstream URL validation or scanning. No further changes are required.


Review by security


Evaluated against 50091941

# Security Review ## Summary This change safely trims a trailing slash from the Gitea base URL when composing the supersede link, preventing malformed double-slash URLs. It is a minimal, defensive improvement with no negative security impact. ## Recommendation **APPROVE** — CI passed and the modification aligns with best practices for URL normalization. From a security perspective, canonicalizing the URL reduces potential quirks in downstream URL validation or scanning. No further changes are required. --- *Review by security* <!-- review-bot:security --> --- *Evaluated against 50091941*
sonnet-review-bot approved these changes 2026-05-02 18:50:28 +00:00
sonnet-review-bot left a comment
First-time contributor

Sonnet Review

Summary

The change correctly trims any trailing slash from the Gitea base URL when constructing the review link, preventing double slashes and aligning with existing client normalization. The modification is small, safe, and CI has passed.

Recommendation

APPROVE — This is a prudent, minimal fix that avoids malformed URLs without introducing risk. The code already imports and uses strings in this file, so the change integrates cleanly. No further changes are necessary.


Review by sonnet


Evaluated against 50091941

# Sonnet Review ## Summary The change correctly trims any trailing slash from the Gitea base URL when constructing the review link, preventing double slashes and aligning with existing client normalization. The modification is small, safe, and CI has passed. ## Recommendation **APPROVE** — This is a prudent, minimal fix that avoids malformed URLs without introducing risk. The code already imports and uses strings in this file, so the change integrates cleanly. No further changes are necessary. --- *Review by sonnet* <!-- review-bot:sonnet --> --- *Evaluated against 50091941*
rodin merged commit cd601bdcf4 into main 2026-05-02 18:52:14 +00:00
rodin deleted branch fix/url-normalization 2026-05-02 18:52:14 +00:00
Sign in to join this conversation.
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#40