File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,12 @@ public struct File: Codable, ResponseConvertible {
32
32
// MARK: - ResponseConvertible
33
33
34
34
public func response( ) async throws -> Response {
35
- Response ( status: . ok, headers: [ " content-disposition " : " inline; filename= \" \( name) \" " ] )
35
+ Response ( status: . ok, headers: [ " Content-Disposition " : " inline; filename= \" \( name) \" " ] )
36
36
. withBody ( content, type: contentType, length: size)
37
37
}
38
38
39
39
public func download( ) async throws -> Response {
40
- Response ( status: . ok, headers: [ " content-disposition " : " attachment; filename= \" \( name) \" " ] )
40
+ Response ( status: . ok, headers: [ " Content-Disposition " : " attachment; filename= \" \( name) \" " ] )
41
41
. withBody ( content, type: contentType, length: size)
42
42
}
43
43
Original file line number Diff line number Diff line change 1
1
extension HTTPHeaders {
2
2
public var contentType : ContentType ? {
3
3
get {
4
- first ( name: " content-type " ) . map ( ContentType . init)
4
+ first ( name: " Content-Type " ) . map ( ContentType . init)
5
5
}
6
6
set {
7
7
if let contentType = newValue {
8
- self . replaceOrAdd ( name: " content-type " , value: " \( contentType. string) " )
8
+ self . replaceOrAdd ( name: " Content-Type " , value: " \( contentType. string) " )
9
9
} else {
10
- self . remove ( name: " content-type " )
10
+ self . remove ( name: " Content-Type " )
11
11
}
12
12
}
13
13
}
14
14
15
15
public var contentLength : Int ? {
16
- get { first ( name: " content-length " ) . map { Int ( $0) } ?? nil }
16
+ get { first ( name: " Content-Length " ) . map { Int ( $0) } ?? nil }
17
17
set {
18
18
if let contentLength = newValue {
19
- self . replaceOrAdd ( name: " content-length " , value: " \( contentLength) " )
19
+ self . replaceOrAdd ( name: " Content-Length " , value: " \( contentLength) " )
20
20
} else {
21
- self . remove ( name: " content-length " )
21
+ self . remove ( name: " Content-Length " )
22
22
}
23
23
}
24
24
}
You can’t perform that action at this time.
0 commit comments