input_curl: send a User-Agent header
Send "Music Player Daemon " + VERSION as the User-Agent request header.
This commit is contained in:
parent
5b089f85fd
commit
422c17ceae
@ -19,6 +19,7 @@
|
|||||||
#include "input_curl.h"
|
#include "input_curl.h"
|
||||||
#include "input_stream.h"
|
#include "input_stream.h"
|
||||||
#include "dlist.h"
|
#include "dlist.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
@ -459,6 +460,8 @@ input_curl_easy_init(struct input_stream *is)
|
|||||||
if (mcode != CURLM_OK)
|
if (mcode != CURLM_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
curl_easy_setopt(c->easy, CURLOPT_USERAGENT,
|
||||||
|
"Music Player Daemon " VERSION);
|
||||||
curl_easy_setopt(c->easy, CURLOPT_HEADERFUNCTION,
|
curl_easy_setopt(c->easy, CURLOPT_HEADERFUNCTION,
|
||||||
input_curl_headerfunction);
|
input_curl_headerfunction);
|
||||||
curl_easy_setopt(c->easy, CURLOPT_WRITEHEADER, is);
|
curl_easy_setopt(c->easy, CURLOPT_WRITEHEADER, is);
|
||||||
|
Loading…
Reference in New Issue
Block a user