[GH-ISSUE #91] Anchors in URLs get encoded incorrectly #63

Closed
opened 2026-02-25 23:33:22 +03:00 by kerem · 4 comments
Owner

Originally created by @muesli on GitHub (May 2, 2018).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/91

When storing a URL with an anchor (e.g. https://foo#bar) the hash character gets encoded incorrectly as %23.

Originally created by @muesli on GitHub (May 2, 2018). Original GitHub issue: https://github.com/go-shiori/shiori/issues/91 When storing a URL with an anchor (e.g. https://foo#bar) the hash character gets encoded incorrectly as `%23`.
kerem closed this issue 2026-02-25 23:33:22 +03:00
Author
Owner

@RadhiFadlillah commented on GitHub (May 26, 2018):

@muesli thanks for the report. This happened because url.ParseRequestURI (which used for validating URL) always assume that the raw URL string doesn't have any #fragment suffix.

To fix this, I've reverted ParseRequestURI to normal Parse in 1baf921. I've also removed the fragment from URL in 7532d36 because AFAIK the anchor tag (#) is only used by web browser, and not by web server.

<!-- gh-comment-id:392264403 --> @RadhiFadlillah commented on GitHub (May 26, 2018): @muesli thanks for the report. This happened because `url.ParseRequestURI` (which used for validating URL) always assume that the raw URL string doesn't have any `#fragment` suffix. To fix this, I've reverted `ParseRequestURI` to normal `Parse` in [`1baf921`](https://github.com/RadhiFadlillah/shiori/commit/1baf921b491db8b1a2218c81cf32471bdd2d3fcd). I've also removed the fragment from URL in [`7532d36`](https://github.com/RadhiFadlillah/shiori/commit/7532d36e7e61ff60395f1819bd9010d7b723074e) because AFAIK the anchor tag (#) is only used by web browser, and not by web server.
Author
Owner

@RadhiFadlillah commented on GitHub (Jun 24, 2018):

Hi @muesli, I’m closing this issue for now because :

  • It has been fixed, and;
  • It has been inactive for a while, so I guess this issue has been solved.

Feels free to reopen it if needed.

Thank you.

<!-- gh-comment-id:399754612 --> @RadhiFadlillah commented on GitHub (Jun 24, 2018): Hi @muesli, I’m closing this issue for now because : - It has been fixed, and; - It has been inactive for a while, so I guess this issue has been solved. Feels free to reopen it if needed. Thank you.
Author
Owner

@mailinglists35 commented on GitHub (Oct 24, 2020):

this is not fixed. i still cannot add url with anchor. using latest release binary. if it is fixed in master, perhaps could you try make a new release or at least a snapshot of the current master?

<!-- gh-comment-id:715638432 --> @mailinglists35 commented on GitHub (Oct 24, 2020): this is not fixed. i still cannot add url with anchor. using latest release binary. if it is fixed in master, perhaps could you try make a new release or at least a snapshot of the current master?
Author
Owner

@mailinglists35 commented on GitHub (Oct 24, 2020):

i mean... i really want to store an url containing a fragment.... :) the fix was to remove support for fragments altogether :-(

<!-- gh-comment-id:715638857 --> @mailinglists35 commented on GitHub (Oct 24, 2020): i mean... i really want to store an url containing a fragment.... :) the fix was to remove support for fragments altogether :-(
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#63
No description provided.