<commit_before>import fs from 'fs';
import path from 'path';

import AbortController from 'abort-controller';
import { app } from 'electron';
import fetch from 'node-fetch';
import { satisfies, coerce } from 'semver';

import {
  CERTIFICATES_CLIENT_CERTIFICATE_REQUESTED,
  SELECT_CLIENT_CERTIFICATE_DIALOG_CERTIFICATE_SELECTED,
  SELECT_CLIENT_CERTIFICATE_DIALOG_DISMISSED,
} from '../navigation/actions';
import { select, dispatch, listen } from '../store';
import { ActionOf } from '../store/actions';
import {
  SERVER_URL_RESOLUTION_REQUESTED,
  SERVER_URL_RESOLVED,
  SERVERS_LOADED,
} from './actions';
import { ServerUrlResolutionStatus, Server, ServerUrlResolutionResult } from './common';

const REQUIRED_SERVER_VERSION_RANGE = '>=2.4.0';

export const convertToURL = (input: string): URL => {
  let url: URL;

  if (/^https?:\/\//.test(input)) {
    url = new URL(input);
  } else {
    url = new URL(`https://${ input }`);
  }

  const { protocol, username, password, hostname, port, pathname } = url;
  return Object.assign(new URL('https://0.0.0.0'), {
    protocol,
    username,
    password,
    hostname,
    port: (protocol === 'http' && port === '80' && undefined)
      || (protocol === 'https' && port === '443' && undefined)
      || port,<commit_msg>fix: Increase server version range (#1770)<commit_after>import fs from 'fs';
import path from 'path';

import AbortController from 'abort-controller';
import { app } from 'electron';
import fetch from 'node-fetch';
import { satisfies, coerce } from 'semver';

import {
  CERTIFICATES_CLIENT_CERTIFICATE_REQUESTED,
  SELECT_CLIENT_CERTIFICATE_DIALOG_CERTIFICATE_SELECTED,
  SELECT_CLIENT_CERTIFICATE_DIALOG_DISMISSED,
} from '../navigation/actions';
import { select, dispatch, listen } from '../store';
import { ActionOf } from '../store/actions';
import {
  SERVER_URL_RESOLUTION_REQUESTED,
  SERVER_URL_RESOLVED,
  SERVERS_LOADED,
} from './actions';
import { ServerUrlResolutionStatus, Server, ServerUrlResolutionResult } from './common';

const REQUIRED_SERVER_VERSION_RANGE = '>=2.0.0';

export const convertToURL = (input: string): URL => {
  let url: URL;

  if (/^https?:\/\//.test(input)) {
    url = new URL(input);
  } else {
    url = new URL(`https://${ input }`);
  }

  const { protocol, username, password, hostname, port, pathname } = url;
  return Object.assign(new URL('https://0.0.0.0'), {
    protocol,
    username,
    password,
    hostname,
    port: (protocol === 'http' && port === '80' && undefined)
      || (protocol === 'https' && port === '443' && undefined)
      || port,
{'fraction_non_alphanumeric': 0.1527723924001551, 'fraction_numerical': 0.010856921287320668, 'mean_word_length': 4.222672064777328, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1506278', 'n_tokens_mistral': 894, 'n_tokens_neox': 846, 'n_words': 208}