Skip to content

Commit 9339bd6

Browse files
authored
Accept decorator throws an error when response is handled manually (#4)
* ci: switch to main * fix: do not write headers when headers are already sent * chore: patch version
1 parent 23bfc14 commit 9339bd6

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Publish
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66

77
jobs:
88
run-checks:

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test
33
on:
44
pull_request:
55
push:
6-
branches: [master]
6+
branches: [main]
77

88
concurrency:
99
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nmshd/typescript-rest",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"description": "A Library to create RESTFul APIs with Typescript",
55
"keywords": [
66
"API",

src/server/service-invoker.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ export class ServiceInvoker {
7575
if (this.postProcessors.length) {
7676
await this.runPostProcessors(context);
7777
}
78-
this.processResponseHeaders(context);
78+
79+
if (!context.response.headersSent) {
80+
this.processResponseHeaders(context);
81+
}
82+
7983
await this.sendValue(result, context);
8084
}
8185

0 commit comments

Comments
 (0)