Skip to content

Commit

Permalink
Flush the operations pipeline when switching to a different engine, f…
Browse files Browse the repository at this point in the history
…ixes #54
  • Loading branch information
papandreou committed Aug 25, 2018
1 parent 27b9c27 commit 74195af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/getFilterInfosAndTargetContentTypeFromQueryString.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ module.exports = function getFilterInfosAndTargetContentTypeFromQueryString(
!currentEngineName ||
candidateEngineNames.indexOf(currentEngineName) === -1
) {
flushOperations();
if (candidateEngineNames.indexOf(defaultEngineName) !== -1) {
currentEngineName = defaultEngineName;
} else {
Expand Down
5 changes: 4 additions & 1 deletion test/getFilterInfosAndTargetContentTypeFromQueryString.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,13 @@ describe('getFilterInfosAndTargetContentTypeFromQueryString', function() {

expect(filterInfosAndTargetContentTypeFromQueryString, 'to satisfy', {
targetContentType: 'image/gif',
operationNames: ['gm'],
operationNames: ['gm', 'sharpOrGm'],
filterInfos: [
{
operationName: 'gm'
},
{
operationName: 'sharpOrGm'
}
]
});
Expand Down

0 comments on commit 74195af

Please sign in to comment.