Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LavrovArtem committed May 31, 2018
1 parent 49a9d0a commit a9f185c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/request-pipeline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const stages = {
else if (!ctx.contentInfo.requireProcessing) {
sendResponseHeaders(ctx);

if (!ctx.isSpecialPage && !ctx.contentInfo.isNotModified) {
if (!ctx.isSpecialPage) {
ctx.requestFilterRules.forEach(rule => {
const configureResponseEvent = new ConfigureResponseEvent(rule, ConfigureResponseEventOptions.DEFAULT);

Expand All @@ -96,7 +96,11 @@ const stages = {
ctx.onResponseEventDataWithoutBody.push({ rule, opts: configureResponseEvent.opts });
});

ctx.destRes.pipe(ctx.res);
if (ctx.contentInfo.isNotModified)
ctx.res.end('');
else
ctx.destRes.pipe(ctx.res);

if (ctx.onResponseEventDataWithoutBody.length) {
ctx.res.on('finish', () => {
const responseInfo = requestEventInfo.createResponseInfo(ctx);
Expand Down

0 comments on commit a9f185c

Please sign in to comment.