1
0
mirror of https://github.com/teoxoy/factorio-blueprint-editor.git synced 2025-03-27 21:39:03 +02:00

encode URI component

This commit is contained in:
teoxoy 2021-01-23 14:56:40 +01:00
parent 8113ed3e4d
commit 70f0e7581f

View File

@ -152,7 +152,7 @@ function getBlueprintOrBookFromSource(source: string): Promise<Blueprint | Book>
const pathParts = url.pathname.slice(1).split('/')
const fetchData = (url: string): Promise<Response> =>
fetch(`__CORS_PROXY_URL__${url}`).then(response => {
fetch(`__CORS_PROXY_URL__${encodeURIComponent(url)}`).then(response => {
if (response.ok) return response
throw new Error('Network response was not ok.')
})