Search code examples
internet-explorermicrosoft-edgehttp-status-code-503

IE and Edge 503 file but can hit it directly


I have some code that injects a script and style into the page. I keep getting 503 errors on the files but the request doesn't reach the server to return the 503.


Solution

  • So it turns out in my code that builds the script that it I was adding an extra colon to the domain with my url building. so the url looked like:

    http://mydomain:/assets/js/index.js
    

    The solution for IE and Rdge was that window.location.port returns an empty string if it is on port 80 and not to just append but check for port being null for other browsers and empty string for IE/Edge