mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-30 09:03:23 -05:00
Waive HTTP authentication on the library for Remote
DAAP queries from Remote won't need HTTP authentication as they all require a valid session-id; Remote can only obtain a valid session-id if its pairing-guid is known to us (it did pair successfully with us).
This commit is contained in:
parent
e016ced119
commit
44bf308701
@ -2128,6 +2128,7 @@ daap_request(struct evhttp_request *req)
|
|||||||
char *uri_parts[7];
|
char *uri_parts[7];
|
||||||
struct evbuffer *evbuf;
|
struct evbuffer *evbuf;
|
||||||
struct evkeyvalq query;
|
struct evkeyvalq query;
|
||||||
|
const char *ua;
|
||||||
cfg_t *lib;
|
cfg_t *lib;
|
||||||
char *libname;
|
char *libname;
|
||||||
char *passwd;
|
char *passwd;
|
||||||
@ -2218,6 +2219,15 @@ daap_request(struct evhttp_request *req)
|
|||||||
|| (strncmp(uri, "/databases/1/items/", strlen("/databases/1/items/")) == 0))
|
|| (strncmp(uri, "/databases/1/items/", strlen("/databases/1/items/")) == 0))
|
||||||
passwd = NULL;
|
passwd = NULL;
|
||||||
|
|
||||||
|
/* Waive HTTP authentication for Remote
|
||||||
|
* Remotes are authentified by their pairing-guid; DAAP queries require a
|
||||||
|
* valid session-id that Remote can only obtain if its pairing-guid is in
|
||||||
|
* our database. So HTTP authentication is waived for Remote.
|
||||||
|
*/
|
||||||
|
ua = evhttp_find_header(req->input_headers, "User-Agent");
|
||||||
|
if ((ua) && (strncmp(ua, "Remote", strlen("Remote")) == 0))
|
||||||
|
passwd = NULL;
|
||||||
|
|
||||||
if (passwd)
|
if (passwd)
|
||||||
{
|
{
|
||||||
libname = cfg_getstr(lib, "name");
|
libname = cfg_getstr(lib, "name");
|
||||||
|
Loading…
Reference in New Issue
Block a user