kaazing / http2-cache.js

2 stars 11 forks source link

use current location when XHR url is missing hostname, protocol and port #60

Closed hthetiot closed 6 years ago

hthetiot commented 6 years ago
        XMLHttpRequest.proxy([{
            "push": "https://rest-accelerator.example.com:8081/event-stream",
            "transport": "wss://rest-accelerator.example.com:8081/",
            "clientLogLevel": "debug",
            "proxy": [
                // Add demos service endpoint here
                "https://origin-server.example.com:8084/api"
            ]
        }]);

        var xhr = new XMLHttpRequest();
        xhr.onreadystatechange = function() {
            console.log(xhr.status, xhr.responseText);
        };
        // Should proxy cause current url is "https://origin-server.example.com:8084"
        xhr.open('GET', "/api/rates/USDGBP");
        xhr.send('');