MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _build_request_headers

Function _build_request_headers

agents/reading-agent/main.py:536–545  ·  view source on GitHub ↗
(*, referer: Optional[str] = None, accept_pdf: bool = False)

Source from the content-addressed store, hash-verified

534
535def _build_request_headers(*, referer: Optional[str] = None, accept_pdf: bool = False) -> Dict[str, str]:
536 headers = dict(DEFAULT_REQUEST_HEADERS)
537 if accept_pdf:
538 headers["Accept"] = "application/pdf,application/octet-stream;q=0.9,*/*;q=0.8"
539 else:
540 headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
541 headers["Upgrade-Insecure-Requests"] = "1"
542 if referer:
543 headers["Referer"] = referer
544 return headers
545
546
547def _create_http_session() -> requests.Session:
548 session = requests.Session()

Callers 1

_http_getFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected