Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FaviconHandler only for servlets #4495

Merged
merged 1 commit into from
Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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