We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d8dfe6 commit c50c46dCopy full SHA for c50c46d
1 file changed
Http.cpp
@@ -178,14 +178,9 @@ Result HTTP::setHTTPSession(const char *uri){
178
if (sendCmdAndWaitForResp(httpPara, OK, 2000) == FALSE)
179
result = ERROR_HTTP_PARA;
180
181
- if (strncmp(HTTPS_PREFIX, uri, strlen(HTTPS_PREFIX)) == 0) {
182
- if (sendCmdAndWaitForResp(HTTPS_ENABLE, OK, 2000) == FALSE) {
183
- result = ERROR_HTTPS_ENABLE;
184
- }
185
- } else {
186
- if (sendCmdAndWaitForResp(HTTPS_DISABLE, OK, 2000) == FALSE) {
187
- result = ERROR_HTTPS_DISABLE;
188
+ bool https = strncmp(HTTPS_PREFIX, uri, strlen(HTTPS_PREFIX)) == 0;
+ if (sendCmdAndWaitForResp(https ? HTTPS_ENABLE : HTTPS_DISABLE, OK, 2000) == FALSE) {
+ result = https ? ERROR_HTTPS_ENABLE : ERROR_HTTPS_DISABLE;
189
}
190
191
if (sendCmdAndWaitForResp(HTTP_CONTENT, OK, 2000) == FALSE)
0 commit comments