Fix svace issue (github.com/jerry-project/iotjs/pull/1929) accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.010540 accepted/tizen/5.5/unified/mobile/hotfix/20201027.073318 accepted/tizen/5.5/unified/wearable/hotfix/20201027.095653 accepted/tizen/unified/20190925.220419 submit/tizen/20190925.035145 submit/tizen_5.5/20191031.000007 submit/tizen_5.5_mobile_hotfix/20201026.185107 submit/tizen_5.5_wearable_hotfix/20201026.184307 tizen_5.5.m2_release
authorHaesik Jun <haesik.jun@samsung.com>
Wed, 25 Sep 2019 03:04:41 +0000 (12:04 +0900)
committerHaesik Jun <haesik.jun@samsung.com>
Wed, 25 Sep 2019 03:04:41 +0000 (12:04 +0900)
Change-Id: I19fe24f2cdff687c5b293b95f296a8dd59adeff3
Signed-off-by: Haesik Jun <haesik.jun@samsung.com>
src/modules/iotjs_module_websocket.c
test/run_pass/test_net_https_post_status_codes.js

index 1be2638..8b76a0c 100644 (file)
@@ -154,7 +154,7 @@ static bool iotjs_check_handshake_key(char *server_key, jerry_value_t jsref) {
     ret_val = false;
   }
 
-  if (strncmp(server_key, (const char *)key, key_len)) {
+  if (key && strncmp(server_key, (const char *)key, key_len)) {
     ret_val = false;
   }
 
index 09c7d91..a7213d0 100644 (file)
@@ -19,25 +19,21 @@ var https = require('https');
 
 var isRequest1Finished = false;
 // 1. POST req
-var data = JSON.stringify({ data: { temp: 50, onFire: false },
-  sdid: '170e5221612b4bc38dce53fd4395174a',
-  type: 'message' });
+var data = JSON.stringify({});
 
 var options = {
   method: 'POST',
-  hostname: 'api.artik.cloud',
-  path: '/v1.1/messages',
+  hostname: 'httpbin.org',
+  path: '/post',
   rejectUnauthorized: false,
   headers: {
     'content-type': 'application/json',
     'content-length': data.length,
-    'authorization': 'Bearer 1718113118564ad495ad03f04116f379'
   }
 };
 
 var getResponseHandler = function(res) {
   var res_body = '';
-
   assert.equal(200, res.statusCode);
 
   var endHandler = function() {