Skip to content

Commit 3b7d7ad

Browse files
committed
cleanup, and use correct signing headers
1 parent 553c9b3 commit 3b7d7ad

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

src/common/AmazonIOTClient.cpp

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
AmazonIOTClient::AmazonIOTClient() : AWSClient4() {
77
this->awsService = "iotdata";
88
this->contentType = "application/json";
9-
this->signedHeaders = "host;x-amz-content-sha256;x-amz-date";
9+
this->signedHeaders = "content-type;host;x-amz-content-sha256;x-amz-date";
1010
this->uri = "/";
1111
this->queryString = "";
1212
this->httpS = true;
@@ -17,36 +17,7 @@ char* AmazonIOTClient::update_shadow(MinimalString shadow, ActionError& actionEr
1717

1818
this->method = "POST";
1919
char* request = createRequest(shadow);
20+
// return request;
2021
char* response = sendData(request);
2122
return response;
22-
23-
24-
// delete[] request;
25-
//
26-
// if (response == NULL) {
27-
// actionError = CONNECTION_ACTIONERROR;
28-
// return 999;
29-
// }
30-
//
31-
// int httpStatusCode = findHttpStatusCode(response);
32-
//
33-
// if (httpStatusCode == 200) {
34-
// return 1;
35-
// }
36-
//
37-
// if (httpStatusCode == 403) {
38-
// char* ts = strstr(response, "earlier than ");
39-
// int pos = ts - response;
40-
//
41-
// char* newts = new char[IOT_EXTRACTED_TIMESTAMP_BUFFER_LENGTH]();
42-
// strncpy(newts, response + pos + 31, IOT_EXTRACTED_TIMESTAMP_BUFFER_LENGTH - 1);
43-
// newts[16] = '\0';
44-
//
45-
// char* time = new char[IOT_FORMATTED_TIMESTAMP_BUFFER_LENGTH]();
46-
// sprintf(time, "%.8s%.6s", newts, newts + 9);
47-
// dateTimeProvider->sync(time);
48-
// return 0;
49-
// }
50-
//
51-
// return httpStatusCode;
5223
}

0 commit comments

Comments
 (0)