8000 fix: sample code updated to assign back response headers. Unit tests … · angular/in-memory-web-api@36b5f67 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 36b5f67

Browse files
vishal423wardbell
authored andcommitted
fix: sample code updated to assign back response headers. Unit tests already exists (#218)
1 parent 3a4fc3a commit 36b5f67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/hero-in-mem-data-override.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class HeroInMemDataOverrideService extends HeroInMemDataService {
9696
// add a response header and report interception to console.log
9797
responseInterceptor(resOptions: ResponseOptions, reqInfo: RequestInfo) {
9898

99-
resOptions.headers.set('x-test', 'test-header');
99+
resOptions.headers = resOptions.headers.set('x-test', 'test-header');
100100
const method = reqInfo.method.toUpperCase();
101101
const body = JSON.stringify(resOptions);
102102
console.log(`responseInterceptor: ${method} ${reqInfo.req.url}: \n${body}`);

0 commit comments

Comments
 (0)
0