Set URI to https for ErrorKind::InsecureURL (#1369)

This commit is contained in:
Nai Hao Cheng 2024-02-01 20:03:30 +09:00 committed by GitHub
parent 2a95944ef5
commit a7c36b5255
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -531,7 +531,7 @@ impl Client {
.await
.is_success()
{
Ok(Status::Error(ErrorKind::InsecureURL(uri.clone())))
Ok(Status::Error(ErrorKind::InsecureURL(uri.to_https()?)))
} else {
// HTTPS is not available for this URI,
// so the original HTTP URL is fine.

View file

@ -107,7 +107,7 @@ pub enum ErrorKind {
MissingGitHubToken,
/// Used an insecure URI where a secure variant was reachable
#[error("This URI is available in HTTPS protocol, but HTTP is provided, use '{0}' instead")]
#[error("This URI is available in HTTPS protocol, but HTTP is provided. Use '{0}' instead")]
InsecureURL(Uri),
/// Error while sending/receiving messages from MPSC channel