Skip to content
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

roo attempts to open file URL without first encoding spaces in filename. #567

Open
Beartech opened this issue Oct 25, 2021 · 1 comment
Open

Comments

@Beartech
Copy link

Issue

I am using Jquery upload to direct upload spreadsheets to AWS for later processing by delayed_job. When a file name had spaces the URL being stored was not encoded to replace the spaces with %20. When roo tried to open the file it got:

URI::InvalidURIError: bad URI(is not URI?): "https://..."

My workaround was to encode the file name in the JS using encodeURI(filename)

This works but it might be better if roo looked for spaces to encode in the url when making a request. I also notice that my web console is complaining:
roo-2.8.3/lib/roo/spreadsheet.rb:27: warning: URI.escape is obsolete
and:
roo-2.8.3/lib/roo/base.rb:547: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

I'm wondering if these area causing my issue. I will fork and attempt to update the deprecated code, and if this does not fix my original issue I will attempt to add some code to check for the need to url escape resources that are being pulled down from the internet vs local files and escape them.

System configuration

Roo version: 2.8.3

Ruby version: 2.74.

@OleksandrPoltavets
Copy link

OleksandrPoltavets commented Apr 1, 2022

I have the same issue trying to open a file directly from AWS S3.

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

No branches or pull requests

2 participants