mattpolzin / mattpolzin/VaporOpenAPI
Authorization header in RouteContext
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 62
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
How can I define the Authorization header? The following doesn't work:
internal struct MyRouteContext: RouteContext {
internal let success: ResponseContext<String> = .init { (response) in
response.status = .ok
response.version = .http1_1
response.headers = [
HTTPHeaders.Name.authorization.description: "Bearer",
HTTPHeaders.Name.contentType.description: HTTPMediaType.json.serialize()
]
}
...
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Swift example in the issue and inspect RouteContext and ResponseContext handling of response.headers. Determine why the Authorization entry is not accepted or emitted, then verify that the example produces the intended header.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100