def route(request: IRequest) -> Deferred: sproc = SessionProcurer(mss) sessions.append((yield sproc.procureSession(request))) sessions.append((yield sproc.procureSession(request))) sessions.append((yield sproc.procureSession(request, forceInsecure=True))) returnValue(b"sessioned")
def route(request: IRequest) -> Deferred: sproc = SessionProcurer(mss) request.write(b"oops...") with self.assertRaises(TooLateForCookies): yield sproc.procureSession(request) request.write(b"bye") request.finish()
def route(request: IRequest) -> Deferred: sproc = SessionProcurer(mss, setCookieOnGET=False) with self.assertRaises(NoSuchSession): yield sproc.procureSession(request) returnValue(b"no session")