Skip to content

Commit

Permalink
Fix link URL parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewc committed Feb 13, 2020
1 parent 6cf0451 commit 25d7a18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/Packages
/*.xcodeproj
xcuserdata/
.swiftpm
4 changes: 3 additions & 1 deletion Sources/Hue/Hue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public class Hue {
}

func url(forEndpoint endpoint: Endpoint) -> URL? {
guard let username = username else { return nil }
guard let username = username else {
return URL(string: "\(bridgeURL)/api/\(endpoint.path)")
}
return URL(string: "\(bridgeURL)/api/\(username)/\(endpoint.path)")
}

Expand Down

0 comments on commit 25d7a18

Please sign in to comment.