Fix for HTTP return status code 1.0 in http_tls

Dependencies:   ublox-at-cellular-interface

Files at this revision

API Documentation at this revision

Comitter:
sanaerathore
Date:
Wed Mar 04 06:51:38 2020 +0000
Parent:
35:6a6ee1adff84
Commit message:
Fix for HTTP return status code 1.0 in Http_tls

Changed in this revision

TESTS/unit_tests/http/main.cpp Show annotated file Show diff for this revision Revisions of this file
ublox-at-cellular-interface.lib Show annotated file Show diff for this revision Revisions of this file
--- a/TESTS/unit_tests/http/main.cpp	Mon Jan 06 14:43:04 2020 +0500
+++ b/TESTS/unit_tests/http/main.cpp	Wed Mar 04 06:51:38 2020 +0000
@@ -254,9 +254,30 @@
                                      "/",
                                      NULL, NULL, 0, NULL,
                                      buf, sizeof (buf)) == NULL);
+                                     
+                                     
+    char s1[] = "HTTP/1.1 200 OK"; // This is what amazon.com returns if TLS is set
+    char s2[] = "HTTP/1.0 200 OK"; // This is what amazon.com returns if TLS is set
+    char* p; 
+    char* q; 
+    int result;
     tr_debug("Received: %s", buf);
+
+    // Find first occurrence of s2 in s1 
+    p = strstr(buf, s1); 
+    q = strstr(buf, s2); 
     // This is what amazon.com returns if TLS is set
-    TEST_ASSERT(strstr(buf, "HTTP/1.1 200 OK") != NULL);
+
+    if (p||q) 
+    { 
+        tr_debug("String found\n"); 
+        result = 1;
+    } else
+    {
+        tr_debug("String not found\n"); 
+        result = NULL;   
+    }
+    TEST_ASSERT(result != NULL);
 
     // Reset the profile and check that this now fails
     TEST_ASSERT(pDriver->httpResetProfile(profile));
--- a/ublox-at-cellular-interface.lib	Mon Jan 06 14:43:04 2020 +0500
+++ b/ublox-at-cellular-interface.lib	Wed Mar 04 06:51:38 2020 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface/#69998003d95a
+https://developer.mbed.org/teams/ublox/code/ublox-at-cellular-interface/#98808477a691