Skip to content

fix(static): guessExt util func return empty string if multiple dots in input - #432

Closed
memotux wants to merge 4 commits into
nuxt:mainfrom
memotux:main
Closed

fix(static): guessExt util func return empty string if multiple dots in input#432
memotux wants to merge 4 commits into
nuxt:mainfrom
memotux:main

Conversation

@memotux

@memotux memotux commented Oct 5, 2021

Copy link
Copy Markdown

Fix guessExt utility functions not guessing file extension on remote domains with multiple . on URL.

That is, with an input like:

"https://scontent.cdninstagram.com/v/t51.29350-15/243949415_185792510361274_152802553443058142_n.jpg?_nc_cat=123&ccb=1-5&_nc_sid=123456&_nc_ohc=htMCe123456NxSi&_nc_ht=scontent.cdninstagram.com&edm=AN12345AAA&oe=615123432522"

'split' functions not return a valid extension, then guessExt function return an empty string. Then, static provider return a file name like /_nuxt/image/243949415_185792510361274_152802553443058142_n[ext]

guessExt function was added in commit 58dd744 from PR#340

This guessExt version is based on getFileExtension function on runtime utils file.

Tested with @nuxt/image playground, static files, and remote files.

@memotux memotux closed this May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant