Commits

Anonymous committed 4ef3cea

Initial files

  • Participants

Comments (0)

Files changed (3)

+
+syntax: regexp
+^\.settings$
+syntax: regexp
+^target$
+syntax: regexp
+^\.classpath$
+syntax: regexp
+^\.project$
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>uk.co.metail</groupId>
+  <artifactId>secure-spoofing-jetty-connector</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <dependencies>
+  	<dependency>
+  		<groupId>org.mortbay.jetty</groupId>
+  		<artifactId>jetty</artifactId>
+  		<version>6.1.24</version>
+  		<exclusions>
+  			<exclusion>
+  				<artifactId>servlet-api</artifactId>
+  				<groupId>org.mortbay.jetty</groupId>
+  			</exclusion>
+  		</exclusions>
+  	</dependency>
+  	<dependency>
+  		<groupId>javax.servlet</groupId>
+  		<artifactId>servlet-api</artifactId>
+  		<version>2.5</version>
+  		<type>pom</type>
+  		<scope>provided</scope>
+  	</dependency>
+  </dependencies>
+</project>

src/main/java/uk/co/metail/jetty/SecureSpoofingConnector.java

+package uk.co.metail.jetty;
+
+import java.io.IOException;
+
+import org.mortbay.io.EndPoint;
+import org.mortbay.jetty.Request;
+import org.mortbay.jetty.nio.SelectChannelConnector;
+
+/**
+ * Sets the scheme of incoming requests to "https" and also arranges that calls
+ * to request.isSecure will return true.
+ * 
+ * @author ojd20
+ * 
+ */
+public class SecureSpoofingConnector extends SelectChannelConnector {
+
+
+	public boolean isConfidential(Request request) {
+		return true;
+	}
+
+	public void customize(EndPoint endpoint, Request request)
+			throws IOException {
+		request.setScheme("https");
+		super.customize(endpoint, request);
+	}
+
+
+}