weserv / images

Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s).
https://wsrv.nl/
BSD 3-Clause "New" or "Revised" License
1.84k stars 187 forks source link

Add http basic auth #341

Closed maffinca69 closed 6 months ago

maffinca69 commented 2 years ago

There are images that are not accessible from the outside and can be accessed either from a specific network or under authorization. For example, https://user:password@google.com/example.png Now in response to such a request we get an error:

{
  "status": "error",
  "code": 400,
  "message": "Unable to parse URI"
}

Will basic auth support be added in the future? Parse login and password and put them in headers

giautm commented 2 years ago

You should sent the request with headers, it should be passed to the upstream.

maffinca69 commented 2 years ago

@giautm Where exactly should this be added (what config file)? If I pass the headers in my request, it doesn't work either and the error remains the same

andrieslouw commented 2 years ago

Is there anyone still using HTTP basic auth? You could use something like proxy_set_header Authorization "Basic base64encodeduserpass";, but make sure to check the manuals and code-examples on this. It's not something we'd support in our public proxy.