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

Escape all remaining reserved chars in direct_fog_url #156

Closed
wants to merge 2 commits into from

Conversation

shirshendu
Copy link

This fixes using direct_fog_url with files that have these ?:[] in the filename.
From URI::Parser
URI regexp pattern for rel_segment
RESERVED = ";/?:@&=+$,[]"
rel_segment = ( unreserved | escaped |
";" | "@" | "&" | "=" | "+" |
"$" | "," )
Hence, '?:[]' need to be escaped for the URI path to not throw exceptions on parsing.

URI regexp pattern for rel_segment
      RESERVED = ";/?:@&=+$,\\[\\]"
      rel_segment   = ( unreserved | escaped |
                          ";" | "@" | "&" | "=" | "+" |
                          "$" | "," )
@shirshendu shirshendu force-pushed the master branch 3 times, most recently from 248804d to af31a08 Compare October 16, 2014 12:35
URI.escape is deprecated for usage with paths
@p8
Copy link
Collaborator

p8 commented Feb 21, 2015

This has been fixed on master by letting carrierwave generate the urls with #155

@p8 p8 closed this Feb 21, 2015
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.

2 participants