[vlc-commits] audioscrobbler: fix request syntax

Rémi Denis-Courmont git at videolan.org
Fri Dec 18 17:09:12 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec 18 18:08:43 2015 +0200| [9502539d8974fafc8356c5fcda9affddf9fe2a10] | committer: Rémi Denis-Courmont

audioscrobbler: fix request syntax

User-Agent and CRLF were invalid. Also use standard capitalization.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9502539d8974fafc8356c5fcda9affddf9fe2a10
---

 modules/misc/audioscrobbler.c |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 4905ce5..2d092a7 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -834,19 +834,17 @@ static void *Run(void *data)
 
         /* we transmit the data */
         int i_net_ret = net_Printf(p_intf, i_post_socket,
-            "POST %s HTTP/1.1\n"
-            "Accept-Encoding: identity\n"
-            "Content-length: %zu\n"
-            "Connection: close\n"
-            "Content-type: application/x-www-form-urlencoded\n"
-            "Host: %s\n"
-            "User-agent: VLC media player/"VERSION"\r\n"
+            "POST %s HTTP/1.1\r\n"
+            "Host: %s\r\n"
+            "User-Agent: "PACKAGE_NAME"/"PACKAGE_VERSION"\r\n"
+            "Connection: close\r\n"
+            "Accept-Encoding: identity\r\n"
+            "Content-Type: application/x-www-form-urlencoded\r\n"
+            "Content-Length: %zu\r\n"
             "\r\n"
             "%s\r\n"
             "\r\n",
-            url->psz_path, strlen(psz_submit),
-            url->psz_host, psz_submit
-       );
+            url->psz_path, url->psz_host, strlen(psz_submit), psz_submit);
 
         free(psz_submit);
         if (i_net_ret == -1)



More information about the vlc-commits mailing list