Revert "Merge branch 'invoker' into 'master'"

This reverts merge request !769
revert-70ac1926
Pahansith Gunathilake 4 years ago
parent 70ac192696
commit 22dc7aaf25

@ -48,7 +48,6 @@ import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.InputStreamBody; import org.apache.http.entity.mime.content.InputStreamBody;
import io.entgra.ui.request.interceptor.beans.ProxyResponse; import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import org.wso2.carbon.context.CarbonContext;
import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
@ -111,11 +110,6 @@ public class InvokerHandler extends HttpServlet {
HttpGet getRequest = new HttpGet(generateBackendRequestURL(req)); HttpGet getRequest = new HttpGet(generateBackendRequestURL(req));
copyRequestHeaders(req, getRequest, false); copyRequestHeaders(req, getRequest, false);
getRequest.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + authData.getAccessToken()); getRequest.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + authData.getAccessToken());
if (apiEndpoint.equals(System.getProperty("iot.reporting.webapp.host"))) {
getRequest.setHeader("Tenant-Id", String.valueOf(
CarbonContext.getThreadLocalCarbonContext().getTenantId()
));
}
ProxyResponse proxyResponse = HandlerUtil.execute(getRequest); ProxyResponse proxyResponse = HandlerUtil.execute(getRequest);
if (HandlerConstants.TOKEN_IS_EXPIRED.equals(proxyResponse.getExecutorResponse())) { if (HandlerConstants.TOKEN_IS_EXPIRED.equals(proxyResponse.getExecutorResponse())) {
proxyResponse = retryRequestWithRefreshedToken(req, resp, getRequest); proxyResponse = retryRequestWithRefreshedToken(req, resp, getRequest);

Loading…
Cancel
Save