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

HTTP API: Disallow GET requests #7097

Merged
merged 2 commits into from
Apr 5, 2020
Merged

HTTP API: Disallow GET requests #7097

merged 2 commits into from
Apr 5, 2020

Commits on Apr 5, 2020

  1. HTTP API: Disallow GET requests on API

    This commit upgrades go-ipfs-cmds and configures the commands HTTP API Handler
    to only allow POST/OPTIONS, disallowing GET and others in the handling of
    command requests in the IPFS HTTP API (where before every type of request
    method was handled, with GET/POST/PUT/PATCH being equivalent).
    
    The Read-Only commands that the HTTP API attaches to the gateway endpoint will
    additional handled GET as they did before (but stop handling PUT,DELETEs).
    
    By limiting the request types we address the possibility that a website
    accessed by a browser abuses the IPFS API by issuing GET requests to it which
    have no Origin or Referrer set, and are thus bypass CORS and CSRF protections.
    
    This is a breaking change for clients that relay on GET requests against the
    HTTP endpoint (usually :5001). Applications integrating on top of the
    gateway-read-only API should still work (including cross-domain access).
    
    Co-Authored-By: Steven Allen <steven@stebalien.com>
    Co-Authored-By: Marcin Rataj <lidel@lidel.org>
    3 people committed Apr 5, 2020
    Configuration menu
    Copy the full SHA
    1b49047 View commit details
    Browse the repository at this point in the history
  2. corehttp: Gateway handler: add Allow headers when returning MethodNot…

    …Allowed
    
    Spec says that response with 405 must set Allow headers.
    hsanjuan committed Apr 5, 2020
    Configuration menu
    Copy the full SHA
    7340543 View commit details
    Browse the repository at this point in the history