mirror of
https://github.com/strapi/strapi.git
synced 2025-09-17 20:40:17 +00:00
change cleanURL description
This commit is contained in:
parent
08cb683bd1
commit
fce7a9112a
@ -4,9 +4,9 @@ import { typeFromMime } from './typeFromMime';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The URL might have query parameters.
|
* The URL might have query parameters.
|
||||||
* Remove them to have a clean URL instead.
|
* Remove them to have a clean URL instead to use as a filename.
|
||||||
*/
|
*/
|
||||||
function cleanURL(url) {
|
function cleanUrl(url) {
|
||||||
// Break URL at ? and take first part (file name, extension)
|
// Break URL at ? and take first part (file name, extension)
|
||||||
url = url.split('?')[0];
|
url = url.split('?')[0];
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ export const urlsToAssets = async urls => {
|
|||||||
timeout: 60000,
|
timeout: 60000,
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const loadedFile = new File([res.data], cleanURL(res.config.url), {
|
const loadedFile = new File([res.data], cleanUrl(res.config.url), {
|
||||||
type: res.headers['content-type'],
|
type: res.headers['content-type'],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user