jonsamwell / angular-http-batcher

Enables HTTP batch request with AngularJS
MIT License
96 stars 28 forks source link

HTTP requests using methods specified as ignoredVersbs are still batched #42

Closed adambarry closed 5 years ago

adambarry commented 5 years ago

UPDATE: Sorry, I just realized my own stupidity in that I'm re-writing the canBatchRequestmethod and thus have to handle the ignoredVerbs myself. Sorry for the inconvenience.

Dear Jon,

I’m using the latest version (1.12), and have an issue regarding the ignoredVerbs, which doesn’t seem to work as it should. Even though I have specified multiple ignoredVerbs (see code-snippet below), all requests using the corresponding HTTP-methods are still included in batches.

My configuration is as follows:

httpBatchConfigProvider
    .setAllowedBatchEndpoint(globalConfig.apiRoot, batchPath, {
        maxBatchedRequestPerCall: 25,
        minimumBatchSize: 2,
        batchRequestCollectionDelay: 100,
        ignoredVerbs: ["post", "put", "patch", "delete"],
        sendCookies: false,
        enabled: batchEnabled,
        canBatchRequest: function (url, method) {
            //......
        }
    });

Your input/help would be greatly appreciated.

Thank you in advance.

Kind regards,

Adam

adambarry commented 5 years ago

As mentioned in the updated comment, I just realized my own stupidity in that I'm re-writing the canBatchRequestmethod and thus have to handle the ignoredVerbs myself. Sorry for the inconvenience.