Skip to content

Commit dcc83f2

Browse files
committed
chore: improve appwrite maintenance path
1 parent c6d4cdf commit dcc83f2

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

tests/benchmarks/http.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,11 @@ function failResponse(response, message) {
458458
}
459459

460460
function cookieHeader(response) {
461-
return response.headers['Set-Cookie'] || response.headers['set-cookie'] || '';
461+
const cookie = response.headers['Set-Cookie'] || response.headers['set-cookie'];
462+
if (Array.isArray(cookie)) {
463+
return cookie.join('; ');
464+
}
465+
return cookie || '';
462466
}
463467

464468
function projectHeaders(projectId) {

tests/benchmarks/ws.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,20 @@ export default function () {
4141
check(payload, {
4242
'connection opened': (r) => connection,
4343
'message received': (r) => checked,
44-
'channels are right': (r) => r === JSON.stringify({
45-
"type": "connected",
46-
"data": {
47-
"channels": [
48-
"files"
49-
],
50-
"user": null
44+
'channels are right': (r) => {
45+
if (typeof r !== 'string') {
46+
return false;
5147
}
52-
})
48+
try {
49+
const parsed = JSON.parse(r);
50+
return parsed.type === 'connected' &&
51+
Array.isArray(parsed.data?.channels) &&
52+
parsed.data.channels.includes('files') &&
53+
parsed.data.user === null;
54+
} catch (_) {
55+
return false;
56+
}
57+
},
5358
})
5459
socket.close();
5560
}, 5000);

0 commit comments

Comments
 (0)