All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.DefaultRequestRootPathProvider Maven / Gradle / Ivy

The newest version!
package hudson;

import javax.servlet.http.HttpServletRequest;

public class DefaultRequestRootPathProvider implements RequestRootPathProvider {

    private static final String REQUEST_ROOT_PATH = "X-Request-Root-Path";

    @Override
    public String getRootPath(HttpServletRequest req) {
        if (req != null) {
            String rootPath = req.getHeader(REQUEST_ROOT_PATH);
            if (rootPath == null) {
                rootPath = req.getContextPath();
            }
            return rootPath;
        } else {
            return "/";
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy