in bindings/xlb/src/index.ts [75:83]
async handleRequestHeaders(headersRequest: CalloutHeadersRequest, actions: Action[]): Promise<ProcessingResponse> {
const resp = await applyPreRequestActions(this.ctx, headersRequest, actions);
if (resp === null) {
return headersRequest.toResponse();
}
// An immediate response is always generated on terminal actions. The only other type of response, CalloutBodyResponse
// is generated when handling a response body.
return (resp as ImmediateResponse).toResponse();
}