Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
Fix that URL parser not able to parse domain with hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuhaow committed Sep 30, 2018
1 parent dc21750 commit 79c9968
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
I will do my best to guarantee that this project adheres to [Semantic Versioning](http://semver.org/) after 1.0.0, but please do read change log before updating.

## 0.13.1

### Fixed
- URL parser can parse domain with hyphen.

## 0.13.0

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/HTTPURL.swift
Expand Up @@ -8,7 +8,7 @@ public class HTTPURL {
public let relativePath: String

// swiftlint:disable:next force_try
static let urlreg = try! NSRegularExpression(pattern: "^(?:(?:(https?):\\/\\/)?([\\w\\.]+)(?::(\\d+))?)?(?:\\/(.*))?$", options: NSRegularExpression.Options.caseInsensitive)
static let urlreg = try! NSRegularExpression(pattern: "^(?:(?:(https?):\\/\\/)?([\\w\\.-]+)(?::(\\d+))?)?(?:\\/(.*))?$", options: NSRegularExpression.Options.caseInsensitive)

init?(string url: String) {
let nsurl = url as NSString
Expand Down

0 comments on commit 79c9968

Please sign in to comment.