Sfoglia il codice sorgente

Add parameter for disabling SSL/TLS certificate validation

tags/v0.2.0
JustAnotherArchivist 4 anni fa
parent
commit
7d53577522
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      qwarc/__init__.py

+ 2
- 2
qwarc/__init__.py Vedi File

@@ -31,7 +31,7 @@ class Item:

self.childItems = []

async def fetch(self, url, responseHandler = qwarc.utils.handle_response_default, method = 'GET', data = None, headers = []):
async def fetch(self, url, responseHandler = qwarc.utils.handle_response_default, method = 'GET', data = None, headers = [], verify_ssl = True):
'''
HTTP GET or POST a URL

@@ -64,7 +64,7 @@ class Item:
try:
with _aiohttp.Timeout(60):
self.logger.info(f'Fetching {url}')
response = await self.session.request(method, url, data = data, headers = headers, allow_redirects = False)
response = await self.session.request(method, url, data = data, headers = headers, allow_redirects = False, verify_ssl = verify_ssl)
try:
ret = await response.read()
except:


Caricamento…
Annulla
Salva