Problem with XHR Post request

#1
Hello, I have a plugin for picking up a parcel location during the checkout.
It displays a map, and after making a choice it sends simple XHR Post ajax request with small payload.
The problem is, when LSCache plugin is enabled the response is empty. By putting die() in the first line of .php handler for the request I've realized it never gets executed. Adding that url (/module/gmparcellocker*) on the url blacklist changes nothing.
I've enabled debug log for LSCache and these are the contents:

Code:
*DEBUG*     v1.7.6.5    2020/06/22 - 09:12:42: [85.244.98.115:60976:474787] (10)   in hook coreCallHook LiteSpeedCache - hookactionDispatcher
*DEBUG*     v1.7.6.5    2020/06/22 - 09:12:42: [85.244.98.115:60976:474787] (6) setNotCacheable - Route not cacheable: gmparcellockerajaxModuleFrontController - Not GET request
*DEBUG*     v1.7.6.5    2020/06/22 - 09:12:42: [85.244.98.115:60976:474787] (8) hookActionDispatcher type=1 controller=gmparcellockerajaxModuleFrontController req=/module/gmparcellocker/ajax :Route not cacheable: gmparcellockerajaxModuleFrontController - Not GET request
When I test the same endpoint with a Postman, with just base headers passed to the request, the response is fine and log looks like this:
Code:
*DEBUG*     v1.7.6.5    2020/06/22 - 09:38:05: [85.244.98.115:32540:774410] (6) setNotCacheable - Route not cacheable: gmparcellockerajaxModuleFrontController - Not GET request
*DEBUG*     v1.7.6.5    2020/06/22 - 09:38:05: [85.244.98.115:32540:774410] (8) hookActionDispatcher type=1 controller=gmparcellockerajaxModuleFrontController req=/module/gmparcellocker/ajax :Route not cacheable: gmparcellockerajaxModuleFrontController - Not GET request
*DEBUG*     v1.7.6.5    2020/06/22 - 09:38:05: [85.244.98.115:32540:774410] (9) vary found & match {"cv":{"name":"_lscache_vary","ov":"curr~1~","nv":"curr~1~","data":{"curr":1}},"vv":{"ov":null,"nv":null},"ps":{"ov":"6a92b5cdac7607d804fc3d4514b80c3b","nv":null}}
*DEBUG*     v1.7.6.5    2020/06/22 - 09:38:05: [85.244.98.115:32540:774410] (4) SetHeader X-Litespeed-Cache-Control: no-cache
seems to me some headers are messing with the cache controller?

this is the exported request that borwser is making to the backend:
Code:
curl 'https://mydomain.com/module/gmparcellocker/ajax' \
  -H 'authority: mydomain.com' \
  -H 'pragma: no-cache' \
  -H 'cache-control: no-cache' \
  -H 'accept: application/json, text/javascript, */*; q=0.01' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36' \
  -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
  -H 'origin: https://mydomain.com' \
  -H 'sec-fetch-site: same-origin' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: https://mydomain.com/zam%C3%B3wienie' \
  -H 'accept-language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7' \
  -H 'cookie: __cfduid=d82212b9da0590d99392ef7a188c23ebc1591645012; _ga=GA1.2.1153355158.1592235643; lsc_private=1ac7ac369520f7703c95b200d14d7cb6; sf_redirect=%7B%22token%22%3A%22f41403%22%2C%22route%22%3A%22admin_performance_save%22%2C%22method%22%3A%22POST%22%2C%22controller%22%3A%7B%22class%22%3A%22PrestaShopBundle%5C%5CController%5C%5CAdmin%5C%5CConfigure%5C%5CAdvancedParameters%5C%5CPerformanceController%22%2C%22method%22%3A%22processFormAction%22%2C%22file%22%3A%22%5C%2Fhome%5C%2Fklient.dhosting.pl%5C%2Fkurek%5C%2Fmydomain.com%5C%2Fpublic_html%5C%2Fsrc%5C%2FPrestaShopBundle%5C%2FController%5C%2FAdmin%5C%2FConfigure%5C%2FAdvancedParameters%5C%2FPerformanceController.php%22%2C%22line%22%3A90%7D%2C%22status_code%22%3A302%2C%22status_text%22%3A%22Found%22%7D; _gid=GA1.2.1523420609.1592671539; PHPSESSID=d1afcff3db44d746af6ec3ed8ab05105; PrestaShop-5c958a3e65a1b2e5e11eb2eebb7411f6=def50200e7fe65b99c5de972351b16e0963c90c52a6b10ee913cba3b6c65b46b4339af3034269841c7d1fa408a0793f7f53c93238b2764b328f5429ba7f5726aaffa094c7e5b4407ffcf6569fa7378f5216ab830a89a32e4c743f4612de97981e46ed95f6cdc1802fd075b5c27ce97beda536f54b42b70738daef3d4c494f2983023c5042c27fbc1ec30dc7d38b82a127b10def75f37701939aeca2fed8a5c98a243f19301b9002922a015ee58b66e9d7dc813a50e7370f20b87c900ac255552ce3b3d8197805ccceb93481aa6c71821261bd99d9a4b013c813aebc76abfcf5358fd854087ee8e83890ab20a5c2751f2e0bfc529682b2008e49af9169cc1ea7dc4b2f557b2c800f8eae7aa91dbfbe54210d9fd7ce1b658d7ab1e47cfad44db0ed05c7cf9d40e552919c8f424742ba987a6f8a4938cbf8f1fdd5ae5a2d8b1319da9eb561410fb93ea755e68b271226111e40eb1324be5ce37e59cc5f373af8011fe4b4e15e6a6e17e81ccdcd2324fee2474e2e49dc1c222132b59cdfb0f8f0d3f5b8320044b81d3651ed13e0e7a2dd4f9b027e6d4b37877730dde1477fde69e30810bb0bcbf999e1d6c82eaf93f60c8046a6aecc0c6b0c0b4401d9bf8bec4ad8bd5a40a347958f362fc3fc135b37b2890b743bca616b9e39de8107fba4d140c63fca4873ecc6f5e6436ea67124c23ca21e42c0c008df6c2e7bc9e8a4ad4b428343f6475806c295454a904e772a0dd30b332fcbabe7e518493d0ce64c92dd88b9ba0d6b7c489ae41937260a3167780168f6d81324fcbe7ef9ecf29210ba67f0a4174e01d6bbbc3f809bdca342cee41e29d28aef61651a236fea8be3feb00e7a4bf8e66c3d899558dd425d759ef98f477cf26ec6dcc38959d4032a5a826f0f38916ecc695ccf4edda5e89493bd907d0d6f1865ffee18732e3ca83c0cf9fc8bf07bbe0a7ca2ddbc28386e44ef7eed0f53d7a77dba8abec9f26b05aeb0f7fbaabc27fd57efb1633792032b5951e81e195784eb83faa53fa624ec25165382bb4f1daa0754e6390ff6803c1cb723ea5f220ca0558102f1e7cf7dd0c14fa424ac465c1; PrestaShop-1045bf819cff19097c0ccb16e52886c2=def50200f775327d43dd76428b25340d925f2a02125115b53bcc574cb6c217dd079b7a76b6f986e094cf598d2a5f965993ac654b67f853c54b3f34c4182ce55d48c726585ef4d5752af4c748c5a650c7c9dc39cefc5b140fed0efd735c45fcc7208627ba8da3a65b7855dec9e75b628240665286a93d120d4661ac8fa4528784e240b0c8e44f068fca5c1538797d7f5a58accc70f03bc504df808e0877f209138b8a6a8bf46a98246e1d2b06ed8f30acc494471744cca456859efcdbaf50be5bf44d709d247a1fc94d7f9a69bf4781e10b6b189801cb33290f8893593af458fd788292c80de8032d88df09d4614a8857634e876fcfef4728fa7797e425ca767c0e24983c8d4fb7ac914f16358f9c933b213f0e033ceb92b1108bd193728818e47fc15419870a7b38599013fa3cee42f3d6da1d95c31b59382f0067baff06b03602dd0bd05cf7d23a61df65367f355d138be8d28c1ae91d576378c16c423bc6dc77cc3e0d7ffc3dfa97f8184c1993641fda9188fdc7cacb3a9eabebb316b80e25be7e11de9b7b6f0ad1b63dd6748753cbb89c5b4c89d8de1cc6e28f14f264e3bb464c048e09e26c35370884334cb72d370ff203a70f68abfb33f4794fd1b61987eca119cc460a4fc89f27329301eea645da8ae5de5cc1588d7140e5479dbb9baceb2477f523b8e6f5eb; _lscache_vary=cg%7E1%7Ecurr%7E1%7E' \
  --data-raw 'cartId=1846&pointData=GDA27A%7C+Rogali%C5%84ska+1%7C+80-809+Gda%C5%84sk' \
  --compressed
 

winkybil

Active Member
#4
I'm writing a script to pull uber API to have a page displaying all my transport options as a side project. It won't be publicly available and will be playing in a closed environment where you won't be able to bring up the console or view source. As such running the XHR request on the machine locally is the most suitable solution for Showbox jiofi.local.html tplinklogin me.
 
Last edited:
Top