File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -156,10 +156,10 @@ do {
156156 let imageBytes = try mrPebbles.readSomeBytes (count : imageSize)
157157 response.setHeader (.contentType , value : MimeType.forExtension (" jpg" ))
158158 response.setHeader (.contentLength , value : " \( imageBytes.count ) " )
159- response.appendBody (bytes : imageBytes)
159+ response.setBody (bytes : imageBytes)
160160} catch {
161161 response.status = .internalServerError
162- response.appendBody (string : " Error handling request: \( error ) " )
162+ response.setBody (string : " Error handling request: \( error ) " )
163163}
164164response.completed ()
165165```
@@ -215,7 +215,7 @@ struct Filter404: HTTPResponseFilter {
215215 func filterHeaders (response : HTTPResponse, callback : (HTTPResponseFilterResult) -> ()) {
216216 if case .notFound = response.status {
217217 response.bodyBytes .removeAll ()
218- response.appendBody (string : " The file \( response.request .path ) was not found." )
218+ response.setBody (string : " The file \( response.request .path ) was not found." )
219219 response.setHeader (.contentLength , value : " \( response.bodyBytes .count ) " )
220220 callback (.done )
221221 } else {
You can’t perform that action at this time.
0 commit comments