sinatra-rest-base 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rest_base/application_helper.rb +2 -1
- data/lib/rest_base/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75d50b09e35bd0c09b5384a9f6c053e8b8b7c22d
|
4
|
+
data.tar.gz: 76e0bcb886023c0e11e1bb0a362d13cc5862f566
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12e058363080135672533f3bfe0d74034d67adca7993bba787c45d8201cdabf8983d0e8ab85e784071803a865df1f93463059e581ae0e4109971229828b92b0e
|
7
|
+
data.tar.gz: 74f257be8746f15e4b43105c87def2243afc46f056055c3d984c3964fd37211d9c079801a639d97e4d48142c444ef0416b9b95358400b986ebe4fde1c229da31
|
@@ -7,6 +7,7 @@ module RestBase
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def has_version?(version)
|
10
|
+
return true unless settings.header_versioning
|
10
11
|
@env['HTTP_ACCEPT'] = "*/*" if @env['HTTP_ACCEPT'].nil?
|
11
12
|
@env['HTTP_ACCEPT'].include?(version)
|
12
13
|
end
|
@@ -57,7 +58,7 @@ module RestBase
|
|
57
58
|
|
58
59
|
response_hash = { }
|
59
60
|
response_hash[:errors] = error_hash unless error_hash.nil? || error_hash.empty?
|
60
|
-
response_hash[:result] = response.body unless response.body.nil?
|
61
|
+
response_hash[:result] = response.body unless response.body.nil? || response.body.empty?
|
61
62
|
response_hash[:forensics] = @forensics if add_forensics_to_response? && !(@forensics.nil? || @forensics.empty?)
|
62
63
|
|
63
64
|
return '' if empty_body_status_code? && (response.body.empty?)
|
data/lib/rest_base/version.rb
CHANGED