Skip to content

Preserve archived redirect Location in content results #76

Description

@oritwoen

Archived redirects are correctly returned without following their destination after #73. But the reader drops Location, so a 301 capture can tell callers only that it moved, not where it moved.

Reproduction on archives 0.5.4, commit 37d69db:

  1. Mock Wayback CDX with [['original','timestamp','statuscode'], ['https://example.com/old','20200202000000','301']].
  2. Mock the raw replay response with status 301, Location: https://example.org/new, Content-Type: text/html, and body <h1>301 Moved Permanently</h1>.
  3. Read that capture through the Wayback library and contentArchives, with cache disabled.

Observed: library _meta.status is 301, but the destination is absent from the complete serialized library and tool results. Only one raw request is made per read, as intended. The text header also does not explicitly expose capture status.

decodeFetchedResponse in src/utils/_content.ts does not retain Location. buildContentHeader in src/tool-operations.ts cannot show it.

Expected: preserve the captured redirect destination as provenance and expose it with status in content output. Treat it as untrusted archived data, sanitize it for display, and never fetch it automatically. Keep archive-internal redirects distinct from page-owned redirects.

A deterministic fixture reproduced the loss without network access. Existing content, Pi extension and MCP suites passed, 127 tests. Checked open and closed issues and PRs. #73 is related and its no-follow behavior must remain, not be reverted. No matching metadata-loss report found.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions