kaazing / http2-cache.js

2 stars 11 forks source link

Flags passed in via XMLHttpRequest.proxy() are not used #103

Closed tejaede closed 6 years ago

tejaede commented 6 years ago

Values passed in to XMLHttpRequest.proxy(config) are not assigned to Configuration.options and therefore are not used.

Example: index.html

<script type="text/javascript" src="node_modules/http2-cache/dist/http2-cache.js"></script>
    <script type="text/javascript">
        XMLHttpRequest.proxy(["./http2-configuration.json"]);
    </script>

http2-configuration.json

{
    "push": "https://example.accelerator:443/event-stream",
    "transport": "wss://example.accelerator:443/",
    "clientLogLevel": "debug",
    "reconnectAuto": false,
    "proxy": [
        "https://my.data.service/query/",
        "https://your.data.service/query/"
    ]
}

configuration#options does not receive these values. It remains the default {debug: false}. This is most noticable in openH2StreamForPush, where the fallbackOnConnectFailure flag is used. https://github.com/kaazing/http2-cache.js/blob/features/fallbackOnConnectFailure/lib/configuration.js#L199