[PR #411] [MERGED] fix: url modification when query param is empty #587

Closed
opened 2026-02-25 23:34:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/411
Author: @fmartingr
Created: 3/26/2022
Status: Merged
Merged: 3/27/2022
Merged by: @fmartingr

Base: masterHead: fix/url-reformat-empty-query-params


📝 Commits (1)

  • dc4504e fix: url modification when query param is empty

📊 Changes

1 file changed (+31 additions, -1 deletions)

View changed files

📝 internal/core/url.go (+31 -1)

📄 Description

This commit fixes URL malformation when trying to remove the utm social
query parameters from an URL, which upon finishing and reconstructing
would attach the equal symbol even if the original URL didn't have it.

This is a known Go "bug" 1 that isn't going to be "fixed". I quote
that because server side should behave the same for ?a=&b=1 and
?a&b=1 for the a parameter, but sometimes that's not the case.

Fixes #409


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/411 **Author:** [@fmartingr](https://github.com/fmartingr) **Created:** 3/26/2022 **Status:** ✅ Merged **Merged:** 3/27/2022 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `fix/url-reformat-empty-query-params` --- ### 📝 Commits (1) - [`dc4504e`](https://github.com/go-shiori/shiori/commit/dc4504e17b0cb9b40a87636bacda608655fb8ac5) fix: url modification when query param is empty ### 📊 Changes **1 file changed** (+31 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `internal/core/url.go` (+31 -1) </details> ### 📄 Description This commit fixes URL malformation when trying to remove the utm social query parameters from an URL, which upon finishing and reconstructing would attach the equal symbol even if the original URL didn't have it. This is a known Go "bug" [1] that isn't going to be "fixed". I quote that because server side should behave the same for `?a=&b=1` and `?a&b=1` for the `a` parameter, but sometimes that's not the case. [1]: https://github.com/golang/go/issues/20820 Fixes #409 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:34:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#587
No description provided.