Minor tweaks to support longer header key value pairs

Dependents:   Car_Bon_car_module

Fork of HTTPClient by David Smart

Revision:
21:d33f7e1ce811
Parent:
20:4ea5255c1b04
Child:
22:f6a3fcf48751
--- a/HTTPClient.cpp	Sun Feb 02 16:47:06 2014 +0000
+++ b/HTTPClient.cpp	Sun Feb 09 22:25:28 2014 +0000
@@ -58,8 +58,19 @@
 
 void HTTPClient::basicAuth(const char* user, const char* password) //Basic Authentification
 {
+    #if 1
+    if (m_basicAuthUser)
+        free(m_basicAuthUser);
+    m_basicAuthUser = (char *)malloc(strlen(user)+1);
+    strcpy(m_basicAuthUser, user);
+    if (m_basicAuthPassword)
+        free(m_basicAuthPassword);
+    m_basicAuthPassword = (char *)malloc(strlen(password)+1);
+    strcpy(m_basicAuthPassword, password);    
+    #else
     m_basicAuthUser = user;
     m_basicAuthPassword = password;
+    #endif
 }
 
 void HTTPClient::customHeaders(const char **headers, size_t pairs)