-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ignore set body after user set status (#741)
- Loading branch information
1 parent
d40de78
commit 4fdb2a6
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/web-koa/test/fixtures/base-app/src/controller/case.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Get, Provide, Controller, Inject } from '@midwayjs/decorator'; | ||
|
||
@Provide() | ||
@Controller('/case') | ||
export class CaseController { | ||
|
||
@Inject() | ||
ctx; | ||
|
||
@Get('/500') | ||
async status500() { | ||
this.ctx.status = 500; | ||
} | ||
|
||
@Get('/500_1') | ||
async status500_1() { | ||
this.ctx.status = 500; | ||
return ''; | ||
} | ||
|
||
@Get('/204') | ||
async status204() { | ||
this.ctx.status = 204; | ||
} | ||
|
||
@Get('/204_1') | ||
async status204_1() { | ||
this.ctx.status = 204; | ||
return ''; | ||
} | ||
|
||
@Get('/204_2') | ||
async status204_2() { | ||
} | ||
|
||
@Get('/204_3') | ||
async status204_3() { | ||
this.ctx.status = 500; | ||
this.ctx.body = undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters