• Alex Potsides's avatar
    fix: allow requests from electron renderer (#201) · bb36028e
    Alex Potsides authored
    * fix: allow requests from electron renderer
    
    The Electron Renderer process runs in an embedded  browser window so
    has access to browser-native `fetch`.  If this is used by
    `ipfs-http-client` to make requests against the HTTP API, the
    `User-Agent` header is set to a value that looks similar to a browser
    but no `Origin` or `Referer` headers are sent.
    
    The change here is to relax the user agent check to allow through
    requests from clients with `'Electron'` in their user agents.
    bb36028e
errors_test.go 4.92 KB