mirror of
https://github.com/strapi/strapi.git
synced 2026-01-08 05:04:10 +00:00
change function name to getFilenameFromURL
This commit is contained in:
parent
7bf2612a15
commit
504c333bcb
@ -6,7 +6,7 @@ import { typeFromMime } from './typeFromMime';
|
||||
* The URL might have query parameters.
|
||||
* Remove them to have a clean URL instead to use as a filename.
|
||||
*/
|
||||
function cleanUrl(url) {
|
||||
function getFilenameFromURL(url) {
|
||||
return new URL(url).pathname.split('/').pop();
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ export const urlsToAssets = async urls => {
|
||||
timeout: 60000,
|
||||
})
|
||||
.then(res => {
|
||||
const loadedFile = new File([res.data], cleanUrl(res.config.url), {
|
||||
const loadedFile = new File([res.data], getFilenameFromURL(res.config.url), {
|
||||
type: res.headers['content-type'],
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user