fog-local icon indicating copy to clipboard operation
fog-local copied to clipboard

0.7 escapes safe characters (change in behavior from 0.6)

Open sethboyles opened this issue 4 years ago • 3 comments

0.6 used URI.escape, which uses URI::DEFAULT_PARSER.regexp[:UNSAFE] (/[^\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]/) under the hood to determine which characters to escape. This did not escape characters like forward slashes.

The change in 0.7 uses a much simpler regex that will result in URIs like this:

%2Fmy%2Furi

When they used to be result like this:

/my/uri

Is there a reason to escape more characters? We would prefer a non-breaking change that escaped the same characters as 0.6.

sethboyles avatar Jan 13 '22 22:01 sethboyles

@geemus would you consider a PR that fixes this regression? This is blocking us from upgrading to Ruby 3, so we would be happy to contribute

sethboyles avatar Jan 19 '22 23:01 sethboyles

Made a PR anyway: https://github.com/fog/fog-local/pull/25

I also added a test that shows the regression.

sethboyles avatar Jan 19 '22 23:01 sethboyles

Hey, thanks. Sorry I think I missed the initial issue as I wasn't actively watching the repo any more.

I believe we made those changes in response to the URI method deprecation and didn't intend for it to change behavior, so a more effective fix (and one that doesn't rely on our own regex) sounds great.

geemus avatar Jan 20 '22 01:01 geemus

This issue has been marked inactive and will be closed if no further activity occurs.

github-actions[bot] avatar Mar 15 '24 02:03 github-actions[bot]

Looks like this was closed some time ago by #25 and we must have forgotten to close this issue at the time.

geemus avatar Mar 15 '24 13:03 geemus