ublox-at-cellular-interface-ext

Dependencies:   ublox-at-cellular-interface

Revision:
28:4427f2e6bbab
Parent:
20:737d307fd4d6
Child:
30:da746bc48735
diff -r 12b47e78f601 -r 4427f2e6bbab TESTS/unit_tests/http/main.cpp
--- a/TESTS/unit_tests/http/main.cpp	Mon Aug 19 12:25:22 2019 +0500
+++ b/TESTS/unit_tests/http/main.cpp	Mon Aug 26 16:55:43 2019 +0500
@@ -223,9 +223,10 @@
     pDriver->httpSetTimeout(profile, HTTP_TIMEOUT);
 
     // Set up the server to talk to and TLS, using the IP address this time just for variety
-    TEST_ASSERT(pDriver->gethostbyname("amazon.com", &address) == 0);
+    TEST_ASSERT(pDriver->gethostbyname("www.amazon.com", &address) == 0);
     TEST_ASSERT(pDriver->httpSetPar(profile, UbloxATCellularInterfaceExt::HTTP_IP_ADDRESS, address.get_ip_address()));
     TEST_ASSERT(pDriver->httpSetPar(profile, UbloxATCellularInterfaceExt::HTTP_SECURE, "1"));
+    TEST_ASSERT(pDriver->httpSetPar(profile, UbloxATCellularInterfaceExt::HTTP_REQ_HEADER, "0:Host:www.amazon.com"));
 
     // Check HTTP get request
     memset(buf, 0, sizeof (buf));
@@ -235,7 +236,7 @@
                                      buf, sizeof (buf)) == NULL);
     tr_debug("Received: %s", buf);
     // This is what amazon.com returns if TLS is set
-    TEST_ASSERT(strstr(buf, "503 Service Temporarily Unavailable") != NULL);
+    TEST_ASSERT(strstr(buf, "HTTP/1.1 200 OK") != NULL);
 
     // Reset the profile and check that this now fails
     TEST_ASSERT(pDriver->httpResetProfile(profile));
@@ -247,7 +248,7 @@
                                      buf, sizeof (buf)) == NULL);
     tr_debug("Received: %s", buf);
     // This is what amazon.com returns if TLS is NOT set
-    TEST_ASSERT(strstr(buf, "301 Moved Permanently") != NULL);
+    TEST_ASSERT(strstr(buf, "HTTP/1.1 403 Forbidden") != NULL);
 
     TEST_ASSERT(pDriver->httpFreeProfile(profile));
     TEST_ASSERT(pDriver->disconnect() == 0);