MCPcopy
hub / github.com/pallets/werkzeug / checking_start_response

Method checking_start_response

src/werkzeug/middleware/lint.py:409–433  ·  view source on GitHub ↗
(
            *args: t.Any, **kwargs: t.Any
        )

Source from the content-addressed store, hash-verified

407 chunks: list[int] = []
408
409 def checking_start_response(
410 *args: t.Any, **kwargs: t.Any
411 ) -> t.Callable[[bytes], None]:
412 if len(args) not in {2, 3}:
413 warn(
414 f"Invalid number of arguments: {len(args)}, expected 2 or 3.",
415 WSGIWarning,
416 stacklevel=2,
417 )
418
419 if kwargs:
420 warn(
421 "'start_response' does not take keyword arguments.",
422 WSGIWarning,
423 stacklevel=2,
424 )
425
426 status: str = args[0]
427 headers: list[tuple[str, str]] = args[1]
428 exc_info: (
429 None | (tuple[type[BaseException], BaseException, TracebackType])
430 ) = args[2] if len(args) == 3 else None
431
432 headers_set[:] = self.check_start_response(status, headers, exc_info)
433 return GuardedWrite(start_response(status, headers, exc_info), chunks)
434
435 app_iter = self.app(environ, t.cast("StartResponse", checking_start_response))
436 self.check_iterator(app_iter)

Callers

nothing calls this directly

Calls 3

check_start_responseMethod · 0.95
GuardedWriteClass · 0.85
start_responseFunction · 0.85

Tested by

no test coverage detected