Fix chat history persisting issue

apim420
commit 7f5137712c

@ -26,6 +26,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
@ -86,6 +87,21 @@ public class HubspotHandler extends HttpServlet {
}
}
@Override
protected void doDelete(HttpServletRequest req, HttpServletResponse resp){
try{
if(validateRequest(req, resp)){
HttpDelete deleteRequest = new HttpDelete(HandlerUtil.generateBackendRequestURL(req,hubspotEndpoint));
deleteRequest.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
deleteRequest.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + chatConfig);
ProxyResponse proxyResponse = HandlerUtil.execute(deleteRequest);
HandlerUtil.handleSuccess(resp, proxyResponse);
}
} catch (IOException e){
log.error("Error occurred when processing DELETE request.", e);
}
}
/***
* Validates the hubspot's incoming request.
*

Loading…
Cancel
Save