mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-25 06:57:58 +01:00
print can now parse urls with credentials
This commit is contained in:
parent
89d4a659db
commit
a08223f243
@ -150,7 +150,11 @@ class Interface extends React.Component {
|
||||
}
|
||||
|
||||
loadFile = (fileUrl) => {
|
||||
fetch(fileUrl)
|
||||
const { origin, pathname, password, username, port } = new URL(fileUrl);
|
||||
const headers = {};
|
||||
if (password && username) headers.Authorization = `Basic ${btoa(`${username}:${password}`)}`;
|
||||
|
||||
fetch(`${origin}${port}${pathname}`, { headers })
|
||||
.then(resonse => resonse.json())
|
||||
.then(json => JSONToSketchData(json))
|
||||
.then(file => createSceneData(file))
|
||||
|
Loading…
Reference in New Issue
Block a user