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

Webmachine::QuotedString#quote fails when trying to quote request.if_match when it's nil #201

Open
jfredett opened this issue Oct 30, 2014 · 1 comment

Comments

@jfredett
Copy link

My resource ends up failing in state g9 because request.if_match is nil. This can be fixed by changing:

        # Escapes quotes within a quoted string.
        def escape_quotes(str)
          str.gsub(/"/, '\\"')
        end

        # Unescapes quotes within a quoted string
        def unescape_quotes(str)
          str.gsub(%r{\\}, '')
        end

with

        # Escapes quotes within a quoted string.
        def escape_quotes(str)
          String(str).gsub(/"/, '\\"')
        end

        # Unescapes quotes within a quoted string
        def unescape_quotes(str)
          String(str).gsub(%r{\\}, '')
        end

But I'm not totally confident I'm doing everything correctly. Totally willing to make the change, but I want to confirm that this is, indeed, unexpected behavior. At the very least, this seems to cause a 415 to be returned, even though I suspect it should return something in the 500-series (since this is a server-side problem).

@jfredett
Copy link
Author

Pull Req above if you want it. I also added some specs around this module. Details in the PR

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 a pull request may close this issue.

1 participant