Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Apr 4, 2024
1 parent baadeb6 commit a29062c
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 60 deletions.
32 changes: 32 additions & 0 deletions lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,38 @@ class Request {
processHeader(this, key, value)
return this
}

onRequestStart (controller) {
this[kHandler].onRequestStart?.(controller)
}

onRequestHeaders (headers) {
this[kHandler].onRequestHeaders?.(headers)
}

onRequestData (chunk) {
this[kHandler].onRequestData?.(chunk)
}

onRequestEnd () {
this[kHandler].onRequestEnd?.()
}

onResponseStart (controller) {
this[kHandler].onResponseStart?.(controller)
}

onResponseHeaders (headers, statusCode, statusText) {
this[kHandler].onResponseHeaders?.(headers, statusCode, statusText)
}

onResponseData (chunk) {
this[kHandler].onResponseData?.(chunk)
}

onResponseEnd () {
this[kHandler].onResponseEnd?.()
}
}

function processHeader (request, key, val) {
Expand Down

0 comments on commit a29062c

Please sign in to comment.