Skip to content

Commit

Permalink
Merge pull request #12 from florianweich/issue-11
Browse files Browse the repository at this point in the history
Removed adding the prefix 'key-' if not there
  • Loading branch information
twof authored May 31, 2018
2 parents 9c5bf4a + 486646c commit 135f522
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Sources/Mailgun/Mailgun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ public struct Mailgun: MailgunProvider {

fileprivate extension Mailgun {
func encode(apiKey: String) throws -> String {
let key = apiKey.contains("key-") ? apiKey : "key-\(apiKey)"
guard let apiKeyData = "api:\(key)".data(using: .utf8) else {
guard let apiKeyData = "api:\(apiKey)".data(using: .utf8) else {
throw MailgunError.encodingProblem
}
let authKey = apiKeyData.base64EncodedData()
Expand Down

0 comments on commit 135f522

Please sign in to comment.