Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gateway subdomains + http proxy mode #6096

Merged
merged 6 commits into from
Mar 18, 2020
Merged

Commits on Mar 18, 2020

  1. rename ProxyOption to P2PProxyOption

    (we're implementing an _actual_ proxy)
    
    License: MIT
    Signed-off-by: Steven Allen <steven@stebalien.com>
    Stebalien committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    11c229b View commit details
    Browse the repository at this point in the history
  2. gateway: simplify/improve dnslink rewrite handling

    Instead of adding a new fake header (that could be spoofed by the client...),
    just read the original request URI from the request object.
    
    This also removes support for suborigins. They have never been implemented in
    browsers and it looks like efforts have stalled. We can add support back if we
    need it but, well, maintaining support was going to be more trouble than it was
    worth.
    
    License: MIT
    Signed-off-by: Steven Allen <steven@stebalien.com>
    Stebalien committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    72490f7 View commit details
    Browse the repository at this point in the history
  3. feat: IPFS_NS_MAP

    Allows static DNSLink mappings with IPFS_NS_MAP.
    
    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel authored and Stebalien committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    848d4c7 View commit details
    Browse the repository at this point in the history
  4. feat(gateway): subdomain and proxy gateway

    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel authored and Stebalien committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    3ecccd6 View commit details
    Browse the repository at this point in the history
  5. fix(gateway): curl without redirect on localhost

    When request is sent to http://localhost:8080/ipfs/$cid response has
    HTTP 301 status code and "Location" header with redirect destination at
    $cid.ipfs.localhost:8080
    
    Redirect is followed by browsersi, but not by commandline tools.
    Status 301 is ignored by curl in default mode: it will print response
    and won't follow redirect, user needs to add -L for that.
    
    To fix curl, we return correct payload in body of HTTP 301 response,
    but set Clear-Site-Data header to ensure Origin sandbox can't be abused.
    
    This requires a surgical workaround:
    If Location header is present in ResponseWriter's Header map,
    we ensure http.ServeContent() returns HTTP 301
    
    Context: #6982
    
    License: MIT
    Signed-off-by: Marcin Rataj <lidel@lidel.org>
    lidel authored and Stebalien committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    f9567a0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    05fe308 View commit details
    Browse the repository at this point in the history