Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AppleLibs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Ullerich
AppleLibs
Commits
55a3f915
Commit
55a3f915
authored
3 years ago
by
Tobias Ullerich
Browse files
Options
Downloads
Patches
Plain Diff
Make bearer token optional
parent
70342fd8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AppleLibs/Network/Requests/Request.swift
+5
-2
5 additions, 2 deletions
AppleLibs/Network/Requests/Request.swift
with
5 additions
and
2 deletions
AppleLibs/Network/Requests/Request.swift
+
5
−
2
View file @
55a3f915
...
...
@@ -36,9 +36,9 @@ public struct BasicAuthentication: Authentication
public
struct
BearerToken
:
Authentication
{
private
let
token
:
String
private
let
token
:
String
?
public
init
(
token
:
String
)
{
public
init
(
token
:
String
?
)
{
self
.
token
=
token
}
...
...
@@ -46,6 +46,9 @@ public struct BearerToken: Authentication
"Authorization"
}
public
var
headerValue
:
String
?
{
guard
let
token
=
token
else
{
return
nil
}
return
"Bearer
\(
token
)
"
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment