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

Table names with embedded space characters are incorrectly escaped. #23

Open
jostockley opened this issue Apr 5, 2017 · 4 comments
Open

Comments

@jostockley
Copy link

jostockley commented Apr 5, 2017

In the protected method, worksheet_url in table.rb the CGI.escape method is called to escape special characters in the url. The problem is that this method replaces space characters with a '+' rather than %20. The '+' would be correct for url parameters but is not correct for spaces in the url path.

Possible fixes:

  1. Change to CGI.escape(s).gsub('+','%20')
  2. Remove it altogether and leave it up to the user to make sure spaces are escaped correctly.
@calebhicks
Copy link

Also running into this issue.

@syrnick
Copy link
Contributor

syrnick commented Dec 7, 2017

@calebhicks does master work for you?

@calebhicks
Copy link

calebhicks commented Dec 7, 2017 via email

@syrnick
Copy link
Contributor

syrnick commented Dec 7, 2017

Strange. master should be using this https://github.com/Airtable/airtable-ruby/blob/master/lib/airtable/table.rb#L116 and that handles spaces correctly

irb(main):014:0> url_encode('//asasdf asdf%a?s & d/')
=> "%2F%2Fasasdf%20asdf%25a%3Fs%20%26%20d%2F"

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

3 participants