Merge pull request #1768 from betagouv/add-comment

Add a comment to explain why we reject 206 responses
This commit is contained in:
gregoirenovel 2018-03-29 15:43:04 +02:00 committed by GitHub
commit feeb0cc80b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,6 +38,9 @@ class ApiEntreprise::API
params: params,
timeout: TIMEOUT)
# Responses with a 206 codes are sometimes not useable,
# as the RNA calls often return a 206 with an error message,
# not a partial response
if response.success? && response.code != 206
JSON.parse(response.body, symbolize_names: true)
else