Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Hummingbird.docc/Articles/RequestDecoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Because the full request is supplied to the `RequestDecoder`. You can make decod
```swift
struct MyRequestDecoder: RequestDecoder {
func decode<T>(_ type: T.Type, from request: Request, context: some RequestContext) async throws -> T where T : Decodable {
guard let header = request.headers[.contentType].first else { throw HTTPError(.badRequest) }
guard let header = request.headers[.contentType] else { throw HTTPError(.badRequest) }
guard let mediaType = MediaType(from: header) else { throw HTTPError(.badRequest) }
switch mediaType {
case .applicationJson:
Expand Down