• Xavier Thompson's avatar
    proxy: Fix forwarded answer of unready request · 88260036
    Xavier Thompson authored
    When forwarding a request to an external master, e.g. frontend request,
    the master might first answer with status code 408 to indicate the
    requested resource is not ready.
    
    The slap library wraps the answer into a ComputerPartition object, even
    when the master sends 408: in that case the object only contains the
    parameters of the original request.
    
    Until now, when the external master answered 408, the proxy simply
    forwarded the ComputerPartition object returned by the slap library
    with code 200, instead of forwarding code 408.
    
    This played against the assumptions of the slap library in the client
    on the receiving end, resulting in a crash. This was the case even when
    using `requestoptional` recipe in buildout.
    
    Now the proxy detects when the object returned by the slap library is
    actually the result of a 408 answer, and aborts with code 408.
    88260036
views.py 46.1 KB