/** * This adds the Request-Context in response header so that the Callee can know what is the caller's AppId. * @param response HttpResponse object */ private static void addTargetAppIdInResponseHeaderViaRequestContext(HttpServletResponse response) { if (response.containsHeader(REQUEST_CONTEXT_HEADER_NAME)) { return; } String appId = getAppIdWithKey(); if (appId.isEmpty()) { return; } // W3C protocol doesn't define any behavior for response headers. // This is purely AI concept and hence we use RequestContextHeader here. response.addHeader(REQUEST_CONTEXT_HEADER_NAME,appId); }
/** * This adds the Request-Context in response header so that the Callee can know what is the caller's AppId. * @param response HttpResponse object */ private static void addTargetAppIdInResponseHeaderViaRequestContext(HttpServletResponse response) { if (response.containsHeader(REQUEST_CONTEXT_HEADER_NAME)) { return; } String appId = getAppIdWithKey(); if (appId.isEmpty()) { return; } // W3C protocol doesn't define any behavior for response headers. // This is purely AI concept and hence we use RequestContextHeader here. response.addHeader(REQUEST_CONTEXT_HEADER_NAME,appId); }