Skip to content

Commit

Permalink
Use Bearer authorization scheme (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Apr 25, 2024
1 parent 1893a95 commit def0e2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Replicate/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ public class Client {
request.httpMethod = method.rawValue

if !token.isEmpty {
request.addValue("Token \(token)", forHTTPHeaderField: "Authorization")
request.addValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
}
request.addValue("application/json", forHTTPHeaderField: "Accept")

Expand Down
2 changes: 1 addition & 1 deletion Tests/ReplicateTests/Helpers/MockURLProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MockURLProtocol: URLProtocol {
let json: String

switch request.value(forHTTPHeaderField: "Authorization") {
case "Token \(Self.validToken)":
case "Bearer \(Self.validToken)":
switch (request.httpMethod, request.url?.absoluteString) {
case ("GET", "https://api.replicate.com/v1/account"?):
statusCode = 200
Expand Down

0 comments on commit def0e2d

Please sign in to comment.