python: certificate ignore was added

This commit is contained in:
Olga Larinova
2022-03-25 13:26:00 +03:00
parent 44061c82a9
commit f809c7e525
5 changed files with 7 additions and 7 deletions

View File

@ -253,7 +253,7 @@ def createFileResponse(response, path, req, meta):
# save file from the given url
def saveFileFromUri(uri, path, req = None, meta = False):
resp = requests.get(uri, stream=True)
resp = requests.get(uri, stream=True, verify = config.DOC_SERV_VERIFY_PEER)
createFileResponse(resp, path, req, meta)
return

View File

@ -58,7 +58,7 @@ def getConverterUri(docUri, fromExt, toExt, docKey, isAsync, filePass = None, la
payload['token'] = jwtManager.encode(payload) # encode a payload object into a body token
headers[jwtHeader] = f'Bearer {headerToken}' # add a header Authorization with a header token with Authorization prefix in it
response = requests.post(config.DOC_SERV_SITE_URL + config.DOC_SERV_CONVERTER_URL, json=payload, headers=headers ) # send the headers and body values to the converter and write the result to the response
response = requests.post(config.DOC_SERV_SITE_URL + config.DOC_SERV_CONVERTER_URL, json=payload, headers=headers, verify = config.DOC_SERV_VERIFY_PEER) # send the headers and body values to the converter and write the result to the response
json = response.json()
return getResponseUri(json)

View File

@ -25,7 +25,6 @@
"""
from asyncio.windows_events import NULL
import config
import requests
import os
@ -160,7 +159,7 @@ def commandRequest(method, key, meta = None):
}
if (meta):
payload.meta = meta
payload['meta'] = meta
headers={'accept': 'application/json'}
@ -171,8 +170,7 @@ def commandRequest(method, key, meta = None):
headers[jwtHeader] = f'Bearer {headerToken}' # add a header Authorization with a header token with Authorization prefix in it
payload['token'] = jwtManager.encode(payload) # encode a payload object into a body token
response = requests.post(documentCommandUrl, json=payload, headers=headers)
response = requests.post(documentCommandUrl, json=payload, headers=headers, verify = config.DOC_SERV_VERIFY_PEER)
if (meta):
return response

View File

@ -127,7 +127,7 @@ def saveAs(request):
filename = docManager.getCorrectName(title, request)
path = docManager.getStoragePath(filename, request)
resp = requests.get(saveAsFileUrl)
resp = requests.get(saveAsFileUrl, verify = config.DOC_SERV_VERIFY_PEER)
if ((len(resp.content) > config.FILE_SIZE_MAX) | (len(resp.content) <= 0)): # check if the file size exceeds the maximum size allowed (5242880)
response.setdefault('error', 'File size is incorrect')