wisp
wisp copied to clipboard
Not enforcing secret key base size in handler definition
I noticed that appropriate size of the secret_key_base is ensured in set_secret_key_base but not when creating a wisp_mist.handler. Is this intentional for some reason?
Hello! What behaviour did you have in mind?
This runs fine:
pub fn main() {
let too_short_key_base = wisp.random_string(63)
wisp_mist.handler(fn(_) { wisp.html_response("", 200) }, too_short_key_base)
}
But this panics:
pub fn main() {
let request = simulate.request(http.Get, "/")
let too_short_key_base = wisp.random_string(63)
wisp.set_secret_key_base(request, too_short_key_base)
}
My assumption was that the first example would panic as well.