Skip to content

Commit e118b5b

Browse files
Add middleware option to override credentials prop
1 parent 4108ef9 commit e118b5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/middleware/render-voyager-page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ export interface MiddlewareOptions {
44
endpointUrl: string;
55
displayOptions?: object;
66
headersJS?: string;
7+
credentials?: string;
78
}
89

910
export default function renderVoyagerPage(options: MiddlewareOptions) {
10-
const { endpointUrl, displayOptions } = options;
11-
const headersJS = options.headersJS ? options.headersJS : '{}';
11+
const { endpointUrl, displayOptions, headersJS = '{}', credentials = 'include' } = options;
1212
return `
1313
<!DOCTYPE html>
1414
<html>
@@ -50,7 +50,7 @@ export default function renderVoyagerPage(options: MiddlewareOptions) {
5050
'Content-Type': 'application/json',
5151
}, ${headersJS}),
5252
body: JSON.stringify({query: introspectionQuery }),
53-
credentials: 'include',
53+
credentials: ${credentials},
5454
}).then(function (response) {
5555
return response.text();
5656
}).then(function (responseBody) {

0 commit comments

Comments
 (0)