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

Method _is_range_request_processable

src/werkzeug/wrappers/response.py:639–652  ·  view source on GitHub ↗

Return ``True`` if `Range` header is present and if underlying resource is considered unchanged when compared with `If-Range` header.

(self, environ: WSGIEnvironment)

Source from the content-addressed store, hash-verified

637 self.response = _RangeWrapper(self.response, start, length) # type: ignore
638
639 def _is_range_request_processable(self, environ: WSGIEnvironment) -> bool:
640 """Return ``True`` if `Range` header is present and if underlying
641 resource is considered unchanged when compared with `If-Range` header.
642 """
643 return (
644 "HTTP_IF_RANGE" not in environ
645 or not is_resource_modified(
646 environ,
647 self.headers.get("etag"),
648 None,
649 self.headers.get("last-modified"),
650 ignore_if_range=False,
651 )
652 ) and "HTTP_RANGE" in environ
653
654 def _process_range_request(
655 self,

Callers 1

Calls 2

is_resource_modifiedFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected