Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

Commit

Permalink
Linting clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
pvzig committed Jan 24, 2018
1 parent 2ea4947 commit 5f2f93d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
.package(url: "https://github.com/SlackKit/SKCore", .upToNextMinor(from: "4.1.0"))
],
targets: [
.target(name: "SKWebAPI",
.target(name: "SKWebAPI",
dependencies: ["SKCore"],
path: "Sources")
]
Expand Down
6 changes: 3 additions & 3 deletions Sources/NetworkInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public struct NetworkInterface {
if parameters.count > 0 {
components?.queryItems = filterNilParameters(parameters).map { URLQueryItem(name: $0.0, value: "\($0.1)") }
}

// As discussed http://www.openradar.me/24076063 and https://stackoverflow.com/a/37314144/407523, Apple considers
// a + and ? as valid characters in a URL query string, but Slack has recently started enforcing that they be
// encoded when included in a query string. As a result, we need to manually apply the encoding after Apple's
Expand All @@ -178,10 +178,10 @@ public struct NetworkInterface {
encodedQuery = encodedQuery?.replacingOccurrences(of: "?", with: "%3F")
encodedQuery = encodedQuery?.replacingOccurrences(of: "+", with: "%2B")
components?.percentEncodedQuery = encodedQuery

return components?.url
}

private func requestBodyData(data: Data, boundaryConstant: String, filename: String, filetype: String) -> Data? {
let boundaryStart = "--\(boundaryConstant)\r\n"
let boundaryEnd = "--\(boundaryConstant)--\r\n"
Expand Down
2 changes: 1 addition & 1 deletion Sources/WebAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ extension WebAPI {
failure: FailureClosure?
) {
let parameters: [String: Any] = ["token": token, "channel": channel, "user": user]
networkInterface.request(endpoint, parameters: parameters, successClosure: {(response) in
networkInterface.request(endpoint, parameters: parameters, successClosure: { _ in
success?(true)
}) {(error) in
failure?(error)
Expand Down

0 comments on commit 5f2f93d

Please sign in to comment.