Skip to content

Commit

Permalink
Merge pull request #5 from jasonnam/develop
Browse files Browse the repository at this point in the history
Release 0.1.5
  • Loading branch information
jasonnam authored Apr 21, 2020
2 parents 558447c + 9ddf763 commit 7df02f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.5] - 2020-04-21
### Added
- Allow empty host flag.

## [0.1.4] - 2019-10-15
### Added
- tvOS deployment target to Podspec.
Expand Down Expand Up @@ -36,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `XCallbackURL`
- `XCallbackURLHandler`

[0.1.5]: /~https://github.com/jasonnam/XCallbackURL/compare/0.1.4...0.1.5
[0.1.4]: /~https://github.com/jasonnam/XCallbackURL/compare/0.1.3...0.1.4
[0.1.3]: /~https://github.com/jasonnam/XCallbackURL/compare/0.1.2...0.1.3
[0.1.2]: /~https://github.com/jasonnam/XCallbackURL/compare/0.1.1...0.1.2
Expand Down
4 changes: 3 additions & 1 deletion Sources/XCallbackURL/XCallbackURLHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ open class XCallbackURLHandler {

open weak var delegate: XCallbackURLHandlerDelegate?

public var allowEmptyHost = false

public let scheme: String

public init(scheme: String) {
Expand Down Expand Up @@ -80,7 +82,7 @@ open class XCallbackURLHandler {
guard let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
return .failure(.invalidURL(url))
}
guard urlComponents.scheme == scheme && urlComponents.host == XCallbackURL.host else {
guard urlComponents.scheme == scheme && ((urlComponents.host == XCallbackURL.host) || (allowEmptyHost && (urlComponents.host == ""))) else {
return .failure(.notXCallbackURL(url))
}

Expand Down
2 changes: 1 addition & 1 deletion XCallbackURL.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'XCallbackURL'
spec.version = '0.1.4'
spec.version = '0.1.5'
spec.authors = { 'Jason Nam' => 'contact@jasonnam.com' }
spec.license = 'MIT'
spec.homepage = '/~https://github.com/jasonnam/XCallbackURL'
Expand Down

0 comments on commit 7df02f1

Please sign in to comment.