<commit_before>﻿using System;

namespace Html2Amp.Web
{
    public class UrlHandler
    {
        public string TryResolveUrl(string host, string url)
        {
            if (string.IsNullOrEmpty(host))
            {
                if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
                {
                    return url;
                }
            }
            else
            {
                var resultUrl = host + url;

                if (Uri.IsWellFormedUriString(resultUrl, UriKind.Absolute))
                {
                    return resultUrl;
                }<commit_msg>Improved generating resultUrl in UrlHandler.cs<commit_after>﻿using System;

namespace Html2Amp.Web
{
    public class UrlHandler
    {
        public string TryResolveUrl(string host, string url)
        {
            if (string.IsNullOrEmpty(host))
            {
                if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
                {
                    return url;
                }
            }
            else
            {
                var resultUrl = host.Trim('/') + "/" + url.Trim('/');

                if (Uri.IsWellFormedUriString(resultUrl, UriKind.Absolute))
                {
                    return resultUrl;
                }
{'fraction_non_alphanumeric': 0.08078431372549019, 'fraction_numerical': 0.001568627450980392, 'mean_word_length': 1.1886792452830188, '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': '2729155', 'n_tokens_mistral': 346, 'n_tokens_neox': 321, 'n_words': 64}