提交 fa107874 编写于 作者: V Volmer

Fix request encoding in tests when string literals are frozen

When running tests with `--enable-frozen-string-literal` or
`# frozen_string_literal: true`, it's currently attempted to mutate the path
string in order to append the format, causing a `RuntimeError`.

```ruby
get '/posts', as: :json
```

```
RuntimeError:
 can't modify frozen String
```

This commit fixes the problem by replacing the mutation with a concatenation,
returning a new string.
上级 0d8d64e9
......@@ -423,7 +423,7 @@ def initialize(mime_name, param_encoder, response_parser, url_encoded_form = fal
end
def append_format_to(path)
path << @path_format unless @url_encoded_form
path += @path_format unless @url_encoded_form
path
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册