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:
Julien BLACHE 2010-01-30 13:04:17 +01:00
parent e016ced119
commit 44bf308701

View File

@ -2128,6 +2128,7 @@ daap_request(struct evhttp_request *req)
char *uri_parts[7];
struct evbuffer *evbuf;
struct evkeyvalq query;
const char *ua;
cfg_t *lib;
char *libname;
char *passwd;
@ -2218,6 +2219,15 @@ daap_request(struct evhttp_request *req)
|| (strncmp(uri, "/databases/1/items/", strlen("/databases/1/items/")) == 0))
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)
{
libname = cfg_getstr(lib, "name");