Supplying extra user agent parameters

merge-requests/30/head
Bob Mottram 2022-05-26 22:58:22 +01:00
parent 80c6ef3eda
commit d302f77415
3 changed files with 8 additions and 4 deletions

View File

@ -1319,7 +1319,8 @@ def dav_month_via_server(session, http_prefix: str,
' </c:filter>\n' + \ ' </c:filter>\n' + \
'</c:calendar-query>' '</c:calendar-query>'
result = \ result = \
get_method("REPORT", xml_str, session, url, params, headers, debug) get_method("REPORT", xml_str, session, url, params, headers, debug,
__version__, http_prefix, domain)
return result return result
@ -1365,5 +1366,6 @@ def dav_day_via_server(session, http_prefix: str,
' </c:filter>\n' + \ ' </c:filter>\n' + \
'</c:calendar-query>' '</c:calendar-query>'
result = \ result = \
get_method("REPORT", xml_str, session, url, params, headers, debug) get_method("REPORT", xml_str, session, url, params, headers, debug,
__version__, http_prefix, domain)
return result return result

View File

@ -58,6 +58,8 @@ def create_session(proxy_type: str):
def url_exists(session, url: str, timeout_sec: int = 3, def url_exists(session, url: str, timeout_sec: int = 3,
http_prefix: str = 'https', domain: str = 'testdomain') -> bool: http_prefix: str = 'https', domain: str = 'testdomain') -> bool:
"""Is the given url resolvable?
"""
if not isinstance(url, str): if not isinstance(url, str):
print('url: ' + str(url)) print('url: ' + str(url))
print('ERROR: url_exists failed, url should be a string') print('ERROR: url_exists failed, url should be a string')
@ -738,6 +740,8 @@ def get_method(method_name: str, xml_str: str,
version: str = __version__, http_prefix: str = 'https', version: str = __version__, http_prefix: str = 'https',
domain: str = 'testdomain', domain: str = 'testdomain',
timeout_sec: int = 20, quiet: bool = False) -> {}: timeout_sec: int = 20, quiet: bool = False) -> {}:
"""Part of the vcard interface
"""
if method_name not in ("REPORT", "PUT", "PROPFIND"): if method_name not in ("REPORT", "PUT", "PROPFIND"):
print("Unrecognized method: " + method_name) print("Unrecognized method: " + method_name)
return None return None

View File

@ -379,8 +379,6 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
new_post_image_section += \ new_post_image_section += \
' <input type="file" id="attachpic" name="attachpic"' ' <input type="file" id="attachpic" name="attachpic"'
formats_string = get_media_formats() formats_string = get_media_formats()
# remove svg as a permitted format
# formats_string = formats_string.replace(', .svg', '').replace('.svg, ', '')
new_post_image_section += \ new_post_image_section += \
' accept="' + formats_string + '">\n' ' accept="' + formats_string + '">\n'
new_post_image_section += \ new_post_image_section += \