Skip to content

Commit

Permalink
SAK-48181 set a proper content-type for response (sakaiproject#11087)
Browse files Browse the repository at this point in the history
* SAK-48181 set a proper content-type for response

* Better cookie logic
  • Loading branch information
ottenhoff authored Dec 8, 2022
1 parent 929cd7e commit 106e659
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.commons.lang3.StringUtils;
import org.tsugi.http.HttpUtil;

import org.sakaiproject.util.RequestFilter;
import org.sakaiproject.util.ResourceLoader;

/**
Expand All @@ -58,6 +59,10 @@ public class OIDCServlet extends HttpServlet {
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);

if (System.getProperty(RequestFilter.SAKAI_COOKIE_PROP) != null) {
cookieName = System.getProperty(RequestFilter.SAKAI_COOKIE_PROP);
}
}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Expand Down Expand Up @@ -191,6 +196,7 @@ private void fancyRedirect(HttpServletRequest request, HttpServletResponse respo
PrintWriter out = null;
try {
out = response.getWriter();
response.setContentType("text/html");
out.println("<script>window.location.href=\"" + redirect + "\";</script>");
out.println("<p>...</p>");
out.print("<p><a href=\"" + redirect + "\" style=\"display: none;\" id=\"linker\">");
Expand Down

0 comments on commit 106e659

Please sign in to comment.