Skip to content

Commit fe3ea83

Browse files
committed
little optimization for DAV
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
1 parent 9623a41 commit fe3ea83

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nc_py_api/_session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ def _get_adapter_kwargs(self, dav: bool) -> dict[str, typing.Any]:
259259
return {
260260
"base_url": self.cfg.dav_endpoint,
261261
"timeout": self.cfg.options.timeout_dav,
262-
"event_hooks": {"request": [self._request_event], "response": [self._response_event]},
262+
"event_hooks": {"request": [], "response": [self._response_event]},
263263
}
264264
return {
265265
"base_url": self.cfg.endpoint,
266266
"timeout": self.cfg.options.timeout,
267-
"event_hooks": {"request": [self._request_event], "response": [self._response_event]},
267+
"event_hooks": {"request": [self._request_event_ocs], "response": [self._response_event]},
268268
}
269269

270-
def _request_event(self, request: Request) -> None:
270+
def _request_event_ocs(self, request: Request) -> None:
271271
str_url = str(request.url)
272272
if re.search(self.__ocs_regexp, str_url) is not None: # this is OCS call
273273
request.url = request.url.copy_merge_params({"format": "json"})

0 commit comments

Comments
 (0)