-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix truncating urls for paths with multiple dots (#46) #45
base: main
Are you sure you want to change the base?
Conversation
Sorry for messing around with the related issue, I thought it was related to #22 but I think actually it's a slightly different problem after re-reading the original description closely. |
@colbyfayock can you take a look on this? |
Sorry, I missed that @orimdominic. That seems reasonable and probably more foolproof, although I think the |
Nice to know @gpoole |
im not great at regex, but one thing to consider is the extension isn't required
|
@colbyfayock as the extension is removed with a @orimdominic I had a go at the solution you suggested but unfortunately it doesn't quite work, since the extracted ID with that method includes the |
This is great! 👍 |
@gpoole Thanks for this! It helps me a lot. |
Fix for public IDs containing multiple dots before the extension getting truncated. For example, in 0.2.4
https://res.cloudinary.com/xyz/image/upload/v111111111/Folder/Name.With.Multiple.Dots.png
is extracted asFolder/Name
instead ofFolder/Name.With.Multiple.Dots
. This fix (maybe incorrectly) assumes everything after the last.
is an extension, but it does correctly include any dots before the last.
in the ID so it should work for most cases.Not sure if it should be more careful about specifically only removing image and video extensions but I thought that might be over-complicating it.
Fixes #46