import { HTTPResponse } from './type/HTTPResponse.ts' import { HTTPRequest } from './type/HTTPRequest.ts' import { ServerRequest } from '../external/http.ts' import {CookieJar} from "./CookieJar.ts"; export class Response implements HTTPResponse { public status = 200 public headers = new Headers() public body = '' public readonly cookies: CookieJar private readonly _deno_req: ServerRequest private readonly _request: HTTPRequest private _sent = false get sent() { return this._sent } constructor(to: HTTPRequest) { this._deno_req = to.to_native this._request = to this.cookies = new CookieJar(to) } send() { this._sent = true return this._deno_req.respond(this) } }