Skip to content

Commit

Permalink
Merge pull request ruby-grape#1824 from ruby-grape/upgrading-description
Browse files Browse the repository at this point in the history
Modifies Upgrading.MD for opening/closing Grape
  • Loading branch information
myxoh authored Nov 26, 2018
2 parents fadabec + 8b00bee commit 3cf89cf
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ with a class that can contain several instances of `Grape::API`.
This changes were done in such a way that no code-changes should be required.
However, if experiencing problems, or relying on private methods and internal behaviour too deeply, it is possible to restore the prior behaviour by replacing the references from `Grape::API` to `Grape::API::Instance`.

Note, this is particularly relevant if you are opening the class `Grape::API` for modification.

**Deprecated**
```ruby
class Grape::API
# your patched logic
...
end
```
**New**
```ruby
class Grape::API::Instance
# your patched logic
...
end
```

#### Changes in rescue_from returned object

Grape will now check the object returned from `rescue_from` and ensure that it is a `Rack::Response`. That makes sure response is valid and avoids exposing service information. Change any code that invoked `Rack::Response.new(...).finish` in a custom `rescue_from` block to `Rack::Response.new(...)` to comply with the validation.
Expand Down

0 comments on commit 3cf89cf

Please sign in to comment.