mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
python: certificate ignore was added
This commit is contained in:
2
web/documentserver-example/python/src/utils/docManager.py
Normal file → Executable file
2
web/documentserver-example/python/src/utils/docManager.py
Normal file → Executable 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
|
||||
|
||||
|
||||
2
web/documentserver-example/python/src/utils/serviceConverter.py
Normal file → Executable file
2
web/documentserver-example/python/src/utils/serviceConverter.py
Normal file → Executable 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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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')
|
||||
|
||||
Reference in New Issue
Block a user