perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Servlet exception mapper cleanup

sukolenvo opened this issue · comments

Spark servlet exception mapper is not cleaned after server stopped. I've created a test to illustrate issue we are facing: master...sukolenvo:test-servlet-clean

Here you can see I am starting server foo, stopping it, and starting another server bar. Although server foo was stopped, error handler is still returning foo.

I suggest to add something like ExceptionMapper.getServletInstance().clear() to SparkFilter.destory()

Can open PR for test and/or fix if needed.