Skip to content

Commit e041463

Browse files
hs0225haesik
authored andcommitted
Fix svace issue (#1929)
IoT.js-DCO-1.0-Signed-off-by: Kim HoSung hs852.kim@samsung.com
1 parent ada0d20 commit e041463

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/modules/iotjs_module_websocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static bool iotjs_check_handshake_key(char *server_key, jerry_value_t jsref) {
150150
ret_val = false;
151151
}
152152

153-
if (strncmp(server_key, (const char *)key, key_len)) {
153+
if (key && strncmp(server_key, (const char *)key, key_len)) {
154154
ret_val = false;
155155
}
156156

test/run_pass/test_net_https_post_status_codes.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,21 @@ var https = require('https');
1919

2020
var isRequest1Finished = false;
2121
// 1. POST req
22-
var data = JSON.stringify({ data: { temp: 50, onFire: false },
23-
sdid: '170e5221612b4bc38dce53fd4395174a',
24-
type: 'message' });
22+
var data = JSON.stringify({});
2523

2624
var options = {
2725
method: 'POST',
28-
hostname: 'api.artik.cloud',
29-
path: '/v1.1/messages',
26+
hostname: 'httpbin.org',
27+
path: '/post',
3028
rejectUnauthorized: false,
3129
headers: {
3230
'content-type': 'application/json',
3331
'content-length': data.length,
34-
'authorization': 'Bearer 1718113118564ad495ad03f04116f379'
3532
}
3633
};
3734

3835
var getResponseHandler = function(res) {
3936
var res_body = '';
40-
4137
assert.equal(200, res.statusCode);
4238

4339
var endHandler = function() {

0 commit comments

Comments
 (0)