Example usage for org.springframework.web.context.request ServletWebRequest getHeaderValues

List of usage examples for org.springframework.web.context.request ServletWebRequest getHeaderValues

Introduction

In this page you can find the example usage for org.springframework.web.context.request ServletWebRequest getHeaderValues.

Prototype

@Override
    @Nullable
    public String[] getHeaderValues(String headerName) 

Source Link

Usage

From source file:org.orcid.core.oauth.service.OrcidAuthorizationEndpoint.java

private URI buildRedirectUri(ServletWebRequest webRequest) throws URISyntaxException {
    String[] referers = webRequest.getHeaderValues("referer");
    if (referers != null && referers.length > 0) {
        return new URI(referers[0]);
    }//from  w  w w  . j a va  2  s.  c o  m
    String uri = "/session-expired";
    String contextPath = webRequest.getContextPath();
    if (contextPath != null) {
        uri = contextPath + uri;
    }
    return new URI(uri);
}