-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Besides upgraded Grape, it changes the response body for 204 HTTP status, now it is an empty string instead of an empty hash. Rack introduced lazy body initialization (rack/rack@8c62821) which only works with strings. However, when 204 HTTP status is returned, Grape doesn't stringify the response (https://github.com/ruby-grape/grape/blob/master/lib/grape/middleware/formatter.rb#L27-L29), thus, a hash is returned as a response body. `Rack::MockResponse` fails with TypeError (no implicit conversion of Hash into String) It could be a bug in the JsonAPI resources gem, why does it return an empty hash for 204 HTTP status?!. Definetly, it isn't a bug in Grape, nor Rack. The logic for formatting the reponse body in Grape hasn't changed for 5 years. The main motivation for this upgrade is a fix for memory leak ruby-grape/grape#2084
- Loading branch information
1 parent
18429e2
commit 2ef9e2f
Showing
22 changed files
with
158 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.3 | ||
TargetRubyVersion: 2.6 | ||
|
||
Style/SignalException: | ||
EnforcedStyle: semantic | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'action_controller' | ||
require 'active_record' | ||
require 'rails' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'rendering' | ||
|
||
module Grape | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'resources' | ||
|
||
module Grape | ||
|
Oops, something went wrong.