refactor: pipe directly response into adding security headers
This commit is contained in:
@@ -20,12 +20,12 @@ pub fn handle(
|
||||
storage: process.Subject(storage.StorageMsg),
|
||||
_secret_key_base: String,
|
||||
) -> wisp.Response {
|
||||
let response = case wisp.path_segments(request) {
|
||||
case wisp.path_segments(request) {
|
||||
[] -> handle_home(request, storage)
|
||||
["paste", key_param] -> handle_paste(request, storage, key_param)
|
||||
_ -> wisp.not_found()
|
||||
}
|
||||
add_security_headers(response)
|
||||
|> add_security_headers
|
||||
}
|
||||
|
||||
fn add_security_headers(response: wisp.Response) -> wisp.Response {
|
||||
|
||||
Reference in New Issue
Block a user