def METHOD_NAME(missing_header):
    if request.exception:
        # Don't raise an exception if Pyramid is already processing an
        # exception view, because that will cause Pyramid to crash.
        return response
    raise HTTPBadRequest(f"CORS preflight request lacks {missing_header} header.")