code: private HttpServletRequest fixupRequest(HttpServletRequest request)
  	{
  		if (isAzureAppService(request))
  		{
  			final StringBuffer requestUrl = request.getRequestURL();
  
  			if (requestUrl.indexOf("http://") == 0)
  			{
  				final String forwardedProto = request.getHeader("x-forwarded-proto");
  
  				if (StringUtils.equals("https", forwardedProto))
  				{
  					// Modify the RequestURL in-place to convert http:// to https://
  					// N.B. this modifies the underlying value so in the future request.getRequestURL will continue to return this value
  					requestUrl.insert(4, 's');
  
  					assert (requestUrl.indexOf("https://") == 0);
  
  					return new AzureAppServiceHttpsServletRequest(request);
  				}
  			}
  
  			return request;
  		}
  		else
  		{
  			// Don't modify the request whatsoever
  			return request;
  		}
  	}
docs: Hack for Microsoft Azure App Service: receives https calls but tomcat reports http:// as the RequestURL<br />
  This means that any redirects sent from within the JAX-RS environment are to http:// pages which is undesirable<br />
  This hack works by recognising an http:// RequestURL with an x-forwarded-proto set of HTTPS.<br />
  In addition if the request is not marked as Secure in this case it will mark it as secure by returning a new
  HttpServletRequest instance to use
  
  @param request
  implementation that also changes isSecure in this case? We'd need a way to guarantee that we were definitely behind the
  Azure HTTP server and not just setting this