Skip to content

Commit 269a429

Browse files
authored
Merge pull request #780 from wurmlab/tt/json-error
Render JSON error when it occurs on a request path ending with .json
2 parents 57098c3 + 54ebe51 commit 269a429

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/sequenceserver/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class Routes < Sinatra::Base
297297
error_data[:more_info] = error.backtrace.join("\n")
298298
end
299299

300-
if request.env['HTTP_ACCEPT'].to_s.include?('application/json')
300+
if request.env['HTTP_ACCEPT'].to_s.include?('application/json') || request.path.end_with?('.json')
301301
status 422
302302
content_type :json
303303
error_data.to_json

0 commit comments

Comments
 (0)