Issues with 2.5 vs 2.3 before/after/redirects

57 views
Skip to first unread message

N C

unread,
Oct 3, 2016, 11:12:58 AM10/3/16
to sparkjava
I'm a die hard fan of the framework and have used it successfully in several apps.  That said, I had to roll back 2.5 to 2.3. I the following issues:

  1.  I too noted that before/after no longer worked for static content. My authentication filter was having issues with static content.
  2.  In my authentication filter I redirect when the session isn't authenticated, and the resultant page now has a mime type of "text/plain" even when expressly set:

              response.type("text/html");
              response.redirect(LOGIN_HTML);

Reverting to 2.3 resolved these issues.

Wayne Doherty

unread,
Jan 21, 2017, 5:16:40 AM1/21/17
to sparkjava
Hi NC

I too have noticed the issue with static files and before after filters.
One area where this is a problem for me is Service Workers being served out of the static file directory. 
If you set a cache time of say:
staticFiles.expireTime(666);

You cannot override this using an after filter, as that code is never called.

I found reverting to 2.3 had problems with gzip encoding, due to issues with incorrect content encoding headers being sent. This only revealed itself when placing the app behind an NGINX reverse proxy. 
Reply all
Reply to author
Forward
0 new messages