Sha256: bea3dcac55be203b272b25bfe2da98a4e3bc697b8c163355172dd8c57d4e6b02

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

package org.mortbay.jetty.handler.rewrite;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.mortbay.jetty.Request;
import org.mortbay.jetty.handler.rewrite.PatternRule;


/**
 * Set the scheme for the request 
 *
 * @author Ervin Varga
 * @author Athena Yao
 */
public class ForwardedSchemeHeaderRule extends HeaderRule {
    private String _scheme="https";

    /* ------------------------------------------------------------ */
    public String getScheme() 
    {
        return _scheme;
    }

    /* ------------------------------------------------------------ */
    /**
     * @param scheme the scheme to set on the request. Defaults to "https"
     */
    public void setScheme(String scheme)
    {
        _scheme = scheme;
    }
    
    /* ------------------------------------------------------------ */
    protected String apply(String target, String value, HttpServletRequest request, HttpServletResponse response) 
    {
        ((Request) request).setScheme(_scheme);
        return target;
    }    
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
miso-java-0.1.5 jetty/contrib/jetty-rewrite-handler/src/main/java/org/mortbay/jetty/handler/rewrite/ForwardedSchemeHeaderRule.java
miso-java-0.1.4 jetty/contrib/jetty-rewrite-handler/src/main/java/org/mortbay/jetty/handler/rewrite/ForwardedSchemeHeaderRule.java
miso-java-0.1.3 jetty/contrib/jetty-rewrite-handler/src/main/java/org/mortbay/jetty/handler/rewrite/ForwardedSchemeHeaderRule.java
miso-java-0.1.2 jetty/contrib/jetty-rewrite-handler/src/main/java/org/mortbay/jetty/handler/rewrite/ForwardedSchemeHeaderRule.java