Skip to content
Snippets Groups Projects
Unverified Commit 2750a7a0 authored by Claire's avatar Claire Committed by GitHub
Browse files

Fix REST API sometimes returning HTML on error (#19135)

Fixes #19115
parent af46584f
No related branches found
No related tags found
No related merge requests found
......@@ -131,4 +131,10 @@ class Api::BaseController < ApplicationController
def disallow_unauthenticated_api_access?
authorized_fetch_mode?
end
private
def respond_with_error(code)
render json: { error: Rack::Utils::HTTP_STATUS_CODES[code] }, status: code
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment