File tree Expand file tree Collapse file tree 2 files changed +28
-15
lines changed Expand file tree Collapse file tree 2 files changed +28
-15
lines changed Original file line number Diff line number Diff line change @@ -311,23 +311,26 @@ extension HTTP.ServerLoop
311
311
{
312
312
cop. reset ( )
313
313
314
- guard
315
- case . GET = h1. method
316
- else
314
+ switch h1. method
317
315
{
318
- return . resource ( " Method requires HTTP/2 " , status : 505 )
319
- }
316
+ case . HEAD :
317
+ return . resource ( " Method not allowed " , status : 405 )
320
318
321
- if let request: IntegralRequest = . init( get: h1. uri,
322
- headers: h1. headers,
323
- address: address,
324
- service: service)
325
- {
326
- return try await cop. pause { try await self . response ( for: request) }
327
- }
328
- else
329
- {
330
- return . resource( " Malformed request " , status: 400 )
319
+ case . GET:
320
+ if let request: IntegralRequest = . init( get: h1. uri,
321
+ headers: h1. headers,
322
+ address: address,
323
+ service: service)
324
+ {
325
+ return try await cop. pause { try await self . response ( for: request) }
326
+ }
327
+ else
328
+ {
329
+ return . resource( " Malformed request " , status: 400 )
330
+ }
331
+
332
+ default :
333
+ return . resource( " Method requires HTTP/2 " , status: 505 )
331
334
}
332
335
}
333
336
}
@@ -456,6 +459,9 @@ extension HTTP.ServerLoop
456
459
457
460
switch method
458
461
{
462
+ case " HEAD " :
463
+ return . resource( " Method not allowed " , status: 405 )
464
+
459
465
case " GET " :
460
466
if let request: IntegralRequest = . init( get: path,
461
467
headers: headers,
Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ extension Swiftinit.RenderablePage
83
83
$0. href = " https://swiftinit.org \( canonical) "
84
84
$0. rel = . canonical
85
85
}
86
+ $0 [ . meta]
87
+ {
88
+ $0. property = . og_url
89
+ $0. content = " https://swiftinit.org \( canonical) "
90
+ }
86
91
}
87
92
// Inlining this saves the client a round-trip to the google fonts API.
88
93
// It is only about 1.87 KB, which is less than 5 percent of the total
@@ -117,6 +122,8 @@ extension Swiftinit.RenderablePage
117
122
118
123
$0 [ . meta] { $0. property = . og_title ; $0. content = self . title }
119
124
$0 [ . meta] { $0. property = . og_image ; $0. content = favicon }
125
+ $0 [ . meta] { $0. property = . og_type ; $0. content = " website " }
126
+ $0 [ . meta] { $0. property = . og_site_name ; $0. content = " Swiftinit " }
120
127
121
128
self . head ( augmenting: & $0, format: format)
122
129
}
You can’t perform that action at this time.
0 commit comments