diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c632c08..77ae4335a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/Utils/HTTPURL.swift b/src/Utils/HTTPURL.swift index f65dc9b85..f69b28f24 100644 --- a/src/Utils/HTTPURL.swift +++ b/src/Utils/HTTPURL.swift @@ -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