/** * Looks up a HTTP response header by name, in case where the response is a list of headers, * the first one is returned. * @param name of the header to look up * @return the single value for the header. */ public String getHeader(String name) { String ret = delegate.getHeader(name); return ret; }
/** * Looks up a HTTP response header by name, in case where the response is a list of headers, * the first one is returned. * @param name of the header to look up * @return the single value for the header. */ public String getHeader(String name) { String ret = delegate.getHeader(name); return ret; }
public static void processNonStandardHeaders(JsonObject json, OAuth2Response reply, String sep) { // inspect the response headers for the non-standard: // X-OAuth-Scopes and X-Accepted-OAuth-Scopes final String xOAuthScopes = reply.getHeader("X-OAuth-Scopes"); final String xAcceptedOAuthScopes = reply.getHeader("X-Accepted-OAuth-Scopes"); if (xOAuthScopes != null) { LOG.trace("Received non-standard X-OAuth-Scopes: "+ xOAuthScopes); if (json.containsKey("scope")) { json.put("scope", json.getString("scope") + sep + xOAuthScopes); } else { json.put("scope", xOAuthScopes); } } if (xAcceptedOAuthScopes != null) { LOG.trace("Received non-standard X-Accepted-OAuth-Scopes: "+ xAcceptedOAuthScopes); json.put("acceptedScopes", xAcceptedOAuthScopes); } }