def METHOD_NAME(context, request):
    if context.content_type == "application/json":
        return context
    response = http_error(
        context, errno=ERRORS.METHOD_NOT_ALLOWED, message="Method not allowed on this endpoint."
    )
    return reapply_cors(request, response)