Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/_native/winhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,21 @@ PyObject *winhttp_urlopen(PyObject *, PyObject *args, PyObject *kwargs) {
WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS,
url_parts.nScheme == INTERNET_SCHEME_HTTPS ? WINHTTP_FLAG_SECURE_DEFAULTS : 0
url_parts.nScheme == INTERNET_SCHEME_HTTPS
? WINHTTP_FLAG_SECURE_DEFAULTS & ~WINHTTP_FLAG_ASYNC
: 0
);
if (!hSession && GetLastError() == ERROR_INVALID_PARAMETER) {
// WINHTTP_FLAG_SECURE_DEFAULTS is not supported on older OS, so we'll
// retry without it.
hSession = WinHttpOpen(
NULL,
WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS,
0
);
}
CHECK_WINHTTP(hSession);

hConnection = WinHttpConnect(
Expand Down
10 changes: 7 additions & 3 deletions src/manage/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
return bool(v)


def _is_valid_url(u):
from .urlutils import is_valid_url
return is_valid_url(u)

Check warning on line 41 in src/manage/config.py

View check run for this annotation

Codecov / codecov/patch

src/manage/config.py#L40-L41

Added lines #L40 - L41 were not covered by tests


def load_global_config(cfg, schema):
try:
from _native import package_get_root
Expand Down Expand Up @@ -184,7 +189,7 @@
v = kind(v)
except (TypeError, ValueError):
raise InvalidConfigurationError(source, key_so_far + k, v)
if v and "path" in opts:
if v and "path" in opts and not _is_valid_url(v):
# Paths from the config file are relative to the config file.
# Paths from the environment are relative to the current working dir
if not from_env:
Expand All @@ -196,8 +201,7 @@
v = v.as_uri()
else:
v = str(v)
from .urlutils import is_valid_url
if not is_valid_url(v):
if not _is_valid_url(v):
raise InvalidConfigurationError(source, key_so_far + k, v)
cfg[k] = v

Expand Down
5 changes: 4 additions & 1 deletion src/manage/urlutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,10 @@

def on_auth(self, url):
# TODO: Try looking for parent paths from URL
return self._auth[url]
try:
return self._auth[url]
except LookupError:
return None

Check warning on line 645 in src/manage/urlutils.py

View check run for this annotation

Codecov / codecov/patch

src/manage/urlutils.py#L642-L645

Added lines #L642 - L645 were not covered by tests

def __next__(self):
if not self._url:
Expand Down
2 changes: 1 addition & 1 deletion src/pymanager/appxmanifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<Resource Language="en-US" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.26100.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19044.0" MaxVersionTested="10.0.26100.0" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
Expand Down