<commit_before>﻿using System;
using System.Windows.Controls;

namespace PackageExplorer {
    public class PublishUrlValidationRule : ValidationRule {

        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo) {
            string stringValue = (string)value;
            Uri url;
            if (Uri.TryCreate(stringValue, UriKind.Absolute, out url)) {
                if (url.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) ||
                    url.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase)) {
                    return ValidationResult.ValidResult;
                }
                else {
                    return new ValidationResult(false, "Publish url must be an HTTP or HTTPS address.");
                }
            }
            else {
                return new ValidationResult(false, "Invalid publish url.");
            }
        }
    }<commit_msg>Fix binding validation which disallow publishing to HTTPS addresses.<commit_after>﻿using System;
using System.Windows.Controls;

namespace PackageExplorer {
    public class PublishUrlValidationRule : ValidationRule {

        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo) {
            string stringValue = (string)value;
            Uri url;
            if (Uri.TryCreate(stringValue, UriKind.Absolute, out url)) {
                if (url.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) ||
                    url.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) {
                    return ValidationResult.ValidResult;
                }
                else {
                    return new ValidationResult(false, "Publish url must be an HTTP or HTTPS address.");
                }
            }
            else {
                return new ValidationResult(false, "Invalid publish url.");
            }
        }
    }
{'fraction_non_alphanumeric': 0.07472417251755266, 'fraction_numerical': 0.0, 'mean_word_length': 2.0319148936170213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3620025', 'n_tokens_mistral': 481, 'n_tokens_neox': 449, 'n_words': 116}