[GH-ISSUE #487] Bugfix: WGET paths are not working as expected with trailing slashes #3337

Closed
opened 2026-03-14 22:12:37 +03:00 by kerem · 4 comments
Owner

Originally created by @cdvv7788 on GitHub (Sep 25, 2020).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/487

Describe the bug

Wget replaces src paths with relative paths. When there is a trailing slash, the relative path fails to point to the correct source.

Steps to reproduce

  1. Run archivebox add https://some_url
  2. Start server with archivebox server
  3. Check the wget output by navigating from the index (https://user-images.githubusercontent.com/3484775/94161808-161e1680-fe54-11ea-8fe2-180aef1bc324.png)
    The css, images, etc. will be broken (404). Removing the trailing slash fixes the issue.

Screenshots or log output

image

Software versions

  • OS: macOS 10.15.6
  • ArchiveBox version: master branch
  • Python version: 3.8.5
Originally created by @cdvv7788 on GitHub (Sep 25, 2020). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/487 #### Describe the bug Wget replaces src paths with relative paths. When there is a trailing slash, the relative path fails to point to the correct source. #### Steps to reproduce 1. Run `archivebox add https://some_url` 2. Start server with `archivebox server` 3. Check the wget output by navigating from the index (https://user-images.githubusercontent.com/3484775/94161808-161e1680-fe54-11ea-8fe2-180aef1bc324.png) The css, images, etc. will be broken (404). Removing the trailing slash fixes the issue. #### Screenshots or log output ![image](https://user-images.githubusercontent.com/5531776/94303336-438dc180-ff33-11ea-8c71-53221e43c1be.png) #### Software versions - OS: macOS 10.15.6 - ArchiveBox version: master branch - Python version: 3.8.5
kerem 2026-03-14 22:12:37 +03:00
Author
Owner

@poblabs commented on GitHub (Sep 25, 2020):

I think I found the issue - at least this helped fix it for me.

Remove the trailing slash from this line, so it looks like: <a href="/{}/{}" ....

<!-- gh-comment-id:699087356 --> @poblabs commented on GitHub (Sep 25, 2020): I think I found the issue - at least this helped fix it for me. Remove the trailing slash [from this line](https://github.com/pirate/ArchiveBox/blob/master/archivebox/core/utils.py#L17), so it looks like: `<a href="/{}/{}" .... `
Author
Owner

@cdvv7788 commented on GitHub (Sep 25, 2020):

I applied @poblabs suggestions in here: https://github.com/pirate/ArchiveBox/pull/488
@pirate if you think it is worth pursuing a fix that allows those paths to support both versions (with and without slash) let me know and I will dig deeper. Otherwise, just close this issue.

<!-- gh-comment-id:699095992 --> @cdvv7788 commented on GitHub (Sep 25, 2020): I applied @poblabs suggestions in here: https://github.com/pirate/ArchiveBox/pull/488 @pirate if you think it is worth pursuing a fix that allows those paths to support both versions (with and without slash) let me know and I will dig deeper. Otherwise, just close this issue.
Author
Owner

@pirate commented on GitHub (Sep 25, 2020):

hmm I remember that trailing slash being important for some edge case when opening files from the filesystem before the archiving was finished. It lets you see a directory index rendered by chrome instead of just an error page.

<!-- gh-comment-id:699144047 --> @pirate commented on GitHub (Sep 25, 2020): hmm I remember that trailing slash being important for some edge case when opening files from the filesystem before the archiving was finished. It lets you see a directory index rendered by chrome instead of just an error page.
Author
Owner

@pirate commented on GitHub (Feb 1, 2021):

This should be fixed in the latest v0.5.4 release. If anyone is still having issues just comment back here with the failing URLs and where they were seen and I'll reopen.

<!-- gh-comment-id:770749333 --> @pirate commented on GitHub (Feb 1, 2021): This should be fixed in the latest v0.5.4 release. If anyone is still having issues just comment back here with the failing URLs and where they were seen and I'll reopen.
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/ArchiveBox#3337
No description provided.