Dispatcher returns 400 for anonymous POST request
AEM 6.5.18
Problem statement: Trying to save PDF in AEM publish DAM and return a externalized PDF URL.
A post servlet is created to POST data with pdf as blobdata to store PDF in DAM. If directly posted to AEM publish, PDF is stored in DAM successfully.
However, if it is posted via dispatcher, we observe 400 - Bad request error.
Things checked/observed:
Enabled trace logs in dispatcher and ensured filter allows POST for servlet path.
Since it is anonymous POST, no CSRF-TOKEN is generated.
All /clientheaders required are allowed in dispatcher
Tried adding LimitRequestBody LimitRequestFieldSize LimitRequestFields LimitRequestLine to sufficient size
Tried to disable mod_security to see if the multipart data is allowed to be posted to narrow root cause.
Above did not resolve the issue and unable to determine the root cause of 400-bad request in dispatcher alone.
Please let me know if any further inputs I missed to share. Kindly let know any pointers and if the data sent using frontend is incorrect.