Storing data send by sendBeacon()

navigator.sendBeacon() sends data using POST method and setting the Request Header Content-Type: text/plain

The data are reaching a custom controller. But there is an issue using services.

The custom controller is working as expected, if I send the data using the swagger doc form of my strapi instance - which sets Content-Type application/json

the custom controller also works if I replace the Content-Type set by sendBeacon() in a nginx proxy using:

proxy_set_header Content-Type application/json;

Does anyone has an idea how I can make my custom controller work with Content-Type: text/plain.

Details are available at: make storing of pageviews, visits and visitors working (#13) · Issues · pwrk / performance-tracker · GitLab

Issue was solved