Add "Cancel" action to proxy intercept

This commit is contained in:
David Stotijn
2022-03-14 09:12:36 +01:00
parent 9dd8464af7
commit e1067ecffb
8 changed files with 297 additions and 10 deletions

View File

@ -581,6 +581,15 @@ func (r *mutationResolver) ModifyRequest(ctx context.Context, input ModifyReques
return &ModifyRequestResult{Success: true}, nil
}
func (r *mutationResolver) CancelRequest(ctx context.Context, id ulid.ULID) (*CancelRequestResult, error) {
err := r.InterceptService.CancelRequest(id)
if err != nil {
return nil, fmt.Errorf("could not cancel http request: %w", err)
}
return &CancelRequestResult{Success: true}, nil
}
func parseSenderRequest(req sender.Request) (SenderRequest, error) {
method := HTTPMethod(req.Method)
if method != "" && !method.IsValid() {