Skip to content

Commit

Permalink
Fix curl options.
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgunter committed Apr 12, 2024
1 parent 12435a4 commit eaa02d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions install/cws-ui/api-docs.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
dom_id: '#swagger-ui',
deepLinking: true,
docExpansion: 'none',
requestInterceptor: function(request) {
//check if request.headers.cwsToken exists. if it does, store the value
//in the cookie. This is because swagger-ui does not support
//sending headers in the request
if (request.headers.cwsToken) {
request.curlOptions = ["--cookie", "cwsToken=" + request.headers.cwsToken];
delete request.headers.cwsToken;
} else {
request.curlOptions = ["--cookie", "cwsToken={REPLACE_WITH_CWS_TOKEN}"]
}
return request;
}
});
});
};
Expand Down

0 comments on commit eaa02d2

Please sign in to comment.