We have recently removed Dancer2::Test usage in favor of Plack::Test, but we forgot that we deploy an example test, and that one still uses Dancer2::Test. Fixed.
Getting the PSGI app should not be done directly via Dancer::Runner because that might change in the future. Although it is available in the DSL, we still want to make this available through the top-level without having to import the DSL.
As @veryrusty suggests, we should be checking that $value is defined If we check that it is true, then we turn 0 and '' into undef Cleanup some of the 'or' ops now that message has a defualt
Should not rely on 5.10+ keywords such as //
Exceptions should not appear after the rendered error page when show_errors is true
Tries to coerce exceptions into strings.
send_error currently specifies the serializer to use, however, other errors still produce an html page. The serializer can be obtained from the context/app so all errors are rendered correctly.
With the default content-type not being applied to a response until its needed (just before content encoding, or before the psgi response is generated), we can restore the previous functionality of allowing other route handlers and hooks to set the content-type before Handler::File renderd the static content into the response. This reverts commit 8171ae8.
Part I in refactoring default_content_type attribute from the Dispatcher to the Response object. This feels a better fit; the only downside is there is no back references to the context or app from the response. Update encode_content() and to_psgi() to add this default_content_type to the response if no content_type was previously specified.
As noted in issue #512 the current JSON serializer ignored most configuration options, so pass them all through.