From f0a064b624e5307b649d0543a1dd403ff88dfa95 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 25 Jan 2012 15:18:50 +0100 Subject: [PATCH] Fixed compilation problem. --- .../org/eclipse/jetty/servlets/CrossOriginFilter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java index e4242cc7e86..bb57608c4b4 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/CrossOriginFilter.java @@ -17,7 +17,7 @@ package org.eclipse.jetty.servlets; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; +import java.util.Enumeration; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -216,12 +216,14 @@ public class CrossOriginFilter implements Filter { // WebSocket clients such as Chrome 5 implement a version of the WebSocket // protocol that does not accept extra response headers on the upgrade response - for (String connection : Collections.list(request.getHeaders("Connection"))) + for (Enumeration connections = request.getHeaders("Connection"); connections.hasMoreElements();) { + String connection = (String)connections.nextElement(); if ("Upgrade".equalsIgnoreCase(connection)) { - for (String upgrade : Collections.list(request.getHeaders("Upgrade"))) + for (Enumeration upgrades = request.getHeaders("Upgrade"); upgrades.hasMoreElements();) { + String upgrade = (String)upgrades.nextElement(); if ("WebSocket".equalsIgnoreCase(upgrade)) return false; }