Skip to content

Commit c24c14a

Browse files
committed
fetch api accepts URLs as well
1 parent 0ed4b33 commit c24c14a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/standalone/swagger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {load} from 'js-yaml';
66
// This code is shared for our own spec as well as user-defined specs via files in repo
77
window.addEventListener('load', async () => {
88
const url = parseUrl(document.getElementById('swagger-ui').getAttribute('data-source'));
9-
const res = await fetch(url.toString());
9+
const res = await fetch(url);
1010
const text = await res.text();
1111
const spec = /\.ya?ml$/i.test(url.pathname) ? load(text) : JSON.parse(text);
1212
const isOwnSpec = url.pathname.endsWith('/swagger.v1.json');

0 commit comments

Comments
 (0)