Skip to content

Commit 4fbbcdc

Browse files
authored
Merge pull request #2127 from HarshMN2345/fix-SER-114-add-null-header-issue
2 parents 3712173 + 413491d commit 4fbbcdc

File tree

1 file changed

+6
-3
lines changed
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function

1 file changed

+6
-3
lines changed

src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,16 @@
8383
let path = '/';
8484
let method = ExecutionMethod.GET;
8585
let body = '';
86-
let headers: [string, string][] = [[null, '']];
86+
let headers: [string, string][] = [['', '']];
8787
8888
async function handleSubmit() {
8989
try {
9090
const headersObject = {};
9191
9292
for (const [name, value] of headers) {
93-
headersObject[name] = value;
93+
if (name && name.trim() !== '') {
94+
headersObject[name] = value;
95+
}
9496
}
9597
9698
await sdk
@@ -134,7 +136,8 @@
134136
$: dateTime = new Date(`${date}T${time}`);
135137
136138
$: filteredKeyList = keyList.filter((key) => {
137-
const name = last(headers)[0];
139+
const lastHeader = last(headers);
140+
const name = lastHeader ? lastHeader[0] : '';
138141
if (!name) return true;
139142
return key.value.toLowerCase().includes(name?.toLowerCase());
140143
});

0 commit comments

Comments
 (0)