Skip to content

Commit

Permalink
Use FaviconHandler only for servlets (#4495)
Browse files Browse the repository at this point in the history
Fixes #4426
  • Loading branch information
Legioth authored and Denis committed Aug 9, 2018
1 parent 0940161 commit 996594c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@

package com.vaadin.flow.server;

import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;
import static java.nio.charset.StandardCharsets.UTF_8;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -47,6 +46,10 @@
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -60,7 +63,6 @@
import com.vaadin.flow.router.Router;
import com.vaadin.flow.server.ServletHelper.RequestType;
import com.vaadin.flow.server.communication.AtmospherePushConnection;
import com.vaadin.flow.server.communication.FaviconHandler;
import com.vaadin.flow.server.communication.HeartbeatHandler;
import com.vaadin.flow.server.communication.PwaHandler;
import com.vaadin.flow.server.communication.SessionRequestHandler;
Expand All @@ -77,7 +79,6 @@
import elemental.json.JsonException;
import elemental.json.JsonObject;
import elemental.json.impl.JsonUtil;
import static java.nio.charset.StandardCharsets.UTF_8;

/**
* An abstraction of the underlying technology, e.g. servlets, for handling
Expand Down Expand Up @@ -294,7 +295,6 @@ public void init() throws ServiceException {
protected List<RequestHandler> createRequestHandlers()
throws ServiceException {
List<RequestHandler> handlers = new ArrayList<>();
handlers.add(new FaviconHandler());
handlers.add(new SessionRequestHandler());
handlers.add(new HeartbeatHandler());
handlers.add(new UidlRequestHandler());
Expand Down Expand Up @@ -1322,8 +1322,7 @@ private int getHeartbeatTimeout() {
*/
private int getUidlRequestTimeout(VaadinSession session) {
return getDeploymentConfiguration().isCloseIdleSessions()
? session.getSession().getMaxInactiveInterval()
: -1;
? session.getSession().getMaxInactiveInterval() : -1;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@

package com.vaadin.flow.server;

import javax.servlet.GenericServlet;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

import javax.servlet.GenericServlet;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.vaadin.flow.function.DeploymentConfiguration;
import com.vaadin.flow.server.communication.FaviconHandler;
import com.vaadin.flow.server.communication.PushRequestHandler;
import com.vaadin.flow.server.startup.RouteRegistry;
import com.vaadin.flow.shared.ApplicationConstants;
Expand Down Expand Up @@ -77,6 +79,7 @@ protected VaadinServletService() {
protected List<RequestHandler> createRequestHandlers()
throws ServiceException {
List<RequestHandler> handlers = super.createRequestHandlers();
handlers.add(0, new FaviconHandler());
handlers.add(0, new BootstrapHandler());
if (isAtmosphereAvailable()) {
try {
Expand Down

0 comments on commit 996594c

Please sign in to comment.