mirror of https://github.com/vapor/docs.git
fixes vapor/vapor#805
This commit is contained in:
parent
b49c3e3717
commit
4942f1c40f
|
|
@ -78,7 +78,7 @@ request.headers["Authorization"] = ... my auth token
|
|||
We generally seek to improve code bases by removing stringly typed code where possible. We can add variables to the headers using generic extensions.
|
||||
|
||||
```swift
|
||||
extension KeyAccessible where Key == HeaderKey, Value == String {
|
||||
extension HTTP.KeyAccessible where Key == HeaderKey, Value == String {
|
||||
var customKey: String? {
|
||||
get {
|
||||
return self["Custom-Key"]
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ response.headers["Authorization"] = ... my auth token
|
|||
We generally seek to improve code bases by removing stringly typed code where possible. We can add variables to the headers using generic extensions.
|
||||
|
||||
```swift
|
||||
extension KeyAccessible where Key == HeaderKey, Value == String {
|
||||
extension HTTP.KeyAccessible where Key == HeaderKey, Value == String {
|
||||
var customKey: String? {
|
||||
get {
|
||||
return self["Custom-Key"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue