kaazing / http2-cache.js

2 stars 11 forks source link

update confProto.getTransportUrl and add spec for path match #27

Closed hthetiot closed 7 years ago

hthetiot commented 7 years ago

Change configuration behavior by matching url with href (proto+host+port+path+query) to be proxy instead of origin only (proto+host+port).

Given:

{
        'transport': 'ws://localhost:7082/path',
        'proxy': [
            'http://localhost:7080/path/proxy',
            'http://localhost:7080/path/notproxy?query=2'
        ]
}

Will proxy:

xhr.open('GET', 'http://localhost:7080/path/proxy', true); xhr.open('GET', 'http://localhost:7080/path/proxy/another', true); xhr.open('GET', 'http://localhost:7080/path/notproxy?query=2', true);

Will not proxy:

xhr2.open('GET', 'http://localhost:7080/path/notproxy?query=1', true);

See test here: