1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-04 22:53:42 +02:00

connection: Save cookiejar only when there's a Set-Cookie header in the response

This commit is contained in:
2023-02-02 10:54:59 +01:00
parent 40a24d3185
commit 18f4d88231

View File

@@ -484,8 +484,9 @@ class CookieJarAuthHandler(AuthHandlerBase):
return False
def process_response(self, url, request_headers, response):
self._cookiejar.extract_cookies(response, MockRequest(url, response.headers))
self._cookiejar.save()
if response.headers.get_all("set-cookie", None):
self._cookiejar.extract_cookies(response, MockRequest(url, response.headers))
self._cookiejar.save()
self._unlock()