Skip to content

fake gateway: blob navigation Content-Disposition and loopback cross-site gate differ from the real gateway #20

Open

Description

@yigitdot

Low priority. The fake gateway in tests/fake_gateway.py differs from the real gateway in two places. Both differences predate #17, and no test or SDK path reads either one today.

1. A blob navigation under /_decdn/ answers inline, not attachment

On a site origin, the real gateway serves a navigation (no Sec-Fetch-Mode, or navigate) of a raw blob under /_decdn/<hash> as Present::Download, which sets Content-Disposition: attachment. See Gateway::site and the disposition in gateway.rs.

The fake serves it through _serve(uri, "site", …), which answers Content-Disposition: inline; filename="<hash>".

2. A loopback site refuses a top-level navigation from another site

On a site origin, the real gateway lets a top-level navigation through from any site (Sec-Fetch-Mode: navigate with Sec-Fetch-Dest: document), so a link opens a site at any path. See browser_gate and may_spend in gateway/site.rs.

The fake's loopback gate in FakeGateway._site answers 403 for any Sec-Fetch-Site other than same-origin or none, including that navigation.

To do

  • Answer attachment for a blob navigation under /_decdn/.
  • Let a top-level navigation through the loopback site gate.
  • Add a contract test for each once something reads it.
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

    bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions