MCPcopy
hub / github.com/scrapinghub/splash / set_result_header

Method set_result_header

splash/qtrender_lua.py:1076–1092  ·  view source on GitHub ↗
(self, name, value)

Source from the content-addressed store, hash-verified

1074
1075 @command()
1076 def set_result_header(self, name, value):
1077 if not all([isinstance(h, str) for h in [name, value]]):
1078 raise ScriptError({
1079 "message": "splash:set_result_header() arguments "
1080 "must be strings",
1081 })
1082
1083 try:
1084 name = name.encode('ascii')
1085 value = value.encode('ascii')
1086 except UnicodeEncodeError:
1087 raise ScriptError({
1088 "message": "splash:set_result_header() arguments must be ascii"
1089 })
1090
1091 header = (name, value)
1092 self._result_headers.append(header)
1093
1094 @command()
1095 def set_user_agent(self, value):

Callers

nothing calls this directly

Calls 2

ScriptErrorClass · 0.90
appendMethod · 0.80

Tested by

no test coverage detected