Skip to content

Commit 0816c39

Browse files
Jake ChampionJakeChampion
authored andcommitted
fix formatting
1 parent bbfa9ce commit 0816c39

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

integration-tests/js-compute/fixtures/client/bin/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ routes.set("/client/tlsJA3MD5", event => {
1313
return pass('ok')
1414
});
1515
routes.set("/client/tlsClientHello", event => {
16+
console.log('hello');
17+
console.log('event.client.tlsJA3MD5', event.client.tlsJA3MD5);
18+
console.log('event.client.tlsClientHello', event.client.tlsClientHello);
1619
error = assert(event.client.tlsClientHello instanceof ArrayBuffer, true, 'event.client.tlsClientHello instanceof ArrayBuffer')
1720
if (error) { return error }
1821
error = assert(typeof event.client.tlsClientHello.byteLength, 'number', 'typeof event.client.tlsClientHello.byteLength')

integration-tests/js-compute/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,18 @@ for (const fixture of testFixtures) {
9898
await zx`npm i`
9999
await $`fastly compute publish -i --quiet --token $FASTLY_API_TOKEN`
100100
core.endGroup()
101-
101+
102102
// get the public domain of the deployed application
103103
domain = JSON.parse(await $`fastly domain list --quiet --version latest --json`)[0].Name
104104
core.notice(`Service is running on https://${domain}`)
105-
105+
106106
const setupPath = join(fixturePath, 'setup.js')
107107
if (existsSync(setupPath)) {
108108
core.startGroup('Extra set-up steps for the service')
109109
await $`${setupPath}`
110110
core.endGroup()
111111
}
112-
112+
113113
core.startGroup('Check service is up and running')
114114
await retry(10, expBackoff('60s', '30s'), async () => {
115115
const response = await request(`https://${domain}`)
@@ -118,9 +118,9 @@ for (const fixture of testFixtures) {
118118
}
119119
})
120120
core.endGroup()
121-
121+
122122
const { default: tests } = await import(join(fixturePath, 'tests.json'), { assert: { type: 'json' } });
123-
123+
124124
core.startGroup('Running tests')
125125
let counter = 0;
126126
await Promise.all(Object.entries(tests).map(async ([title, test]) => {
@@ -147,7 +147,7 @@ for (const fixture of testFixtures) {
147147
await $`${teardownPath}`
148148
core.endGroup()
149149
}
150-
150+
151151
core.startGroup('Delete service')
152152
// Delete the service now the tests have finished
153153
await zx`fastly service delete --quiet --service-name "${serviceName}" --force --token $FASTLY_API_TOKEN`

runtime/js-compute-runtime/fastly-world/fastly_world_adapter.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,26 @@ bool fastly_http_req_downstream_client_ip_addr(fastly_world_list_u8_t *ret, fast
189189
bool fastly_http_req_downstream_tls_cipher_openssl_name(fastly_world_string_t *ret,
190190
fastly_error_t *err) {
191191
auto default_size = 128;
192-
ret->ptr = static_cast<char *>(cabi_malloc(default_size, 1));
193-
auto status = fastly::req_downstream_tls_cipher_openssl_name(
194-
reinterpret_cast<char *>(ret->ptr), default_size, &ret->len);
192+
ret->ptr = static_cast<char *>(cabi_malloc(default_size, 4));
193+
auto status = fastly::req_downstream_tls_cipher_openssl_name(reinterpret_cast<char *>(ret->ptr),
194+
default_size, &ret->len);
195195
if (status == FASTLY_ERROR_BUFFER_LEN) {
196196
cabi_realloc(ret->ptr, default_size, 4, ret->len);
197-
status = fastly::req_downstream_tls_cipher_openssl_name(reinterpret_cast<char *>(ret->ptr), ret->len, &ret->len);
197+
status = fastly::req_downstream_tls_cipher_openssl_name(reinterpret_cast<char *>(ret->ptr),
198+
ret->len, &ret->len);
198199
}
199200
return convert_result(status, err);
200201
}
201202

202203
bool fastly_http_req_downstream_tls_protocol(fastly_world_string_t *ret, fastly_error_t *err) {
203204
auto default_size = 32;
204-
ret->ptr = static_cast<char *>(cabi_malloc(default_size, 1));
205-
auto status = fastly::req_downstream_tls_protocol(reinterpret_cast<char *>(ret->ptr), default_size, &ret->len);
205+
ret->ptr = static_cast<char *>(cabi_malloc(default_size, 4));
206+
auto status = fastly::req_downstream_tls_protocol(reinterpret_cast<char *>(ret->ptr),
207+
default_size, &ret->len);
206208
if (status == FASTLY_ERROR_BUFFER_LEN) {
207209
cabi_realloc(ret->ptr, default_size, 4, ret->len);
208-
status = fastly::req_downstream_tls_protocol(reinterpret_cast<char *>(ret->ptr), ret->len, &ret->len);
210+
status = fastly::req_downstream_tls_protocol(reinterpret_cast<char *>(ret->ptr), ret->len,
211+
&ret->len);
209212
}
210213
return convert_result(status, err);
211214
}
@@ -226,11 +229,11 @@ bool fastly_http_req_downstream_tls_raw_client_certificate(fastly_world_list_u8_
226229

227230
bool fastly_http_req_downstream_tls_ja3_md5(fastly_world_list_u8_t *ret, fastly_error_t *err) {
228231
auto default_size = 16;
229-
ret->ptr = static_cast<uint8_t *>(cabi_malloc(default_size, 1));
232+
ret->ptr = static_cast<uint8_t *>(cabi_malloc(default_size, 4));
230233
auto status = fastly::req_downstream_tls_ja3_md5(reinterpret_cast<char *>(ret->ptr), &ret->len);
231234
if (status == FASTLY_ERROR_BUFFER_LEN) {
232235
cabi_realloc(ret->ptr, default_size, 4, ret->len);
233-
status = fastly::req_downstream_tls_ja3_md5(reinterpret_cast<char *>(ret->ptr, &ret->len);
236+
status = fastly::req_downstream_tls_ja3_md5(reinterpret_cast<char *>(ret->ptr), &ret->len);
234237
}
235238
return convert_result(status, err);
236239
}

0 commit comments

Comments
 (0)