Assuming I have a simple html + javascript application. I have a script from a cdn included in the html via the script:src tag. This script sends a request to a server using jquery's ajax library. Is it possible to intercept and send the request made by the script to a different server instead of the server that it currently sends the request to.
The script sends a request to a server but I would like to send the request first to my personal api, inject some headers using data that is only available in my api, then send the request to their server from my api, thus using my api server as a proxy.