elsif response.status == 200
      render plain: "No media for the DOI", status: :not_found
    elsif response.status == 401
      response.headers.delete_if { |key| key == 'X-Credential-Username' }
      render plain: "Bad credentials", status: :unauthorized