The Hapi server.match method converts badRequest responses into Hoek assertion errors [1]. This causes malformed URLs to result in 500 errors in applications that use this plugin.
This fix attempts to decode the URI earlier and throws the appropriate badRequest error if it encounters any decoding errors.
The Hapi
server.match
method convertsbadRequest
responses into Hoek assertion errors [1]. This causes malformed URLs to result in 500 errors in applications that use this plugin.This fix attempts to decode the URI earlier and throws the appropriate
badRequest
error if it encounters any decoding errors.[1] https://github.com/hapijs/hapi/blob/master/lib/server.js#L350