MCPcopy Create free account
hub / github.com/delinoio/oss / gitlab_https_rejection_reason

Function gitlab_https_rejection_reason

crates/binpm/src/assets.rs:503–535  ·  view source on GitHub ↗
(asset: &ReleaseAsset)

Source from the content-addressed store, hash-verified

501}
502
503pub(crate) fn gitlab_https_rejection_reason(asset: &ReleaseAsset) -> Option<String> {
504 if !is_https_url(&asset.url) {
505 return Some(format!(
506 "gitlab asset link URL is not HTTPS: {}; configure the GitLab release link to use \
507 HTTPS or a secure direct asset URL",
508 sanitized_origin(&asset.url)
509 ));
510 }
511
512 if let Some(provider_url) = &asset.provider_url {
513 if !is_https_url(provider_url) {
514 return Some(format!(
515 "gitlab direct asset URL is not HTTPS: {}; configure the GitLab release link to \
516 use HTTPS or omit the insecure direct asset URL",
517 sanitized_origin(provider_url)
518 ));
519 }
520 }
521
522 if asset.final_url_https == Some(false) {
523 let target = asset
524 .final_url
525 .as_deref()
526 .map(sanitized_origin)
527 .unwrap_or_else(|| "unknown redirect target".to_string());
528 return Some(format!(
529 "gitlab asset redirect target is not HTTPS: {target}; configure the GitLab release \
530 link to redirect to HTTPS"
531 ));
532 }
533
534 None
535}
536
537pub(crate) fn gitlab_https_diagnostic_url(asset: &ReleaseAsset) -> String {
538 if asset.final_url_https == Some(false) {

Callers 3

select_manifest_assetFunction · 0.85
score_assetFunction · 0.85
gitlab_https_eligibleFunction · 0.85

Calls 1

is_https_urlFunction · 0.70

Tested by

no test coverage detected