Skip to content

Commit

Permalink
feature: support extra headers in notModifiedResponse (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Dec 27, 2024
1 parent 0fa9870 commit 32168f9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import * as HttpHeader from '../HttpHeader/HttpHeader.ts'
import * as HttpStatusCode from '../HttpStatusCode/HttpStatusCode.ts'

export class NotModifiedResponse extends Response {
constructor(etag: string) {
constructor(etag: string, extraHeaders: Record<string, string> = {}) {
super(null, {
status: HttpStatusCode.NotModified,
headers: {
[HttpHeader.CrossOriginResourcePolicy]: 'same-origin',
[HttpHeader.Etag]: etag,
...extraHeaders,
},
})
}
Expand Down

0 comments on commit 32168f9

Please sign in to comment.