mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix chat history persisting issue
This commit is contained in:
parent
dda5860e57
commit
e2d95f76ba
@ -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…
Reference in New Issue
Block a user