Skip to content

Commit

Permalink
vmod_h2: VRT_fail if called outside of client context
Browse files Browse the repository at this point in the history
  • Loading branch information
daghf authored and dridi committed Oct 18, 2023
1 parent cfba263 commit 0ecefa8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/libvmod_h2/vmod_h2.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ h2get(VRT_CTX)
uintptr_t *up;

CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); // $Restrict client
if (ctx->req == NULL) {
VRT_fail(ctx,
"vmod_h2 can only be called from client-side VCL.");
return (NULL);
}
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
if (ctx->req->transport != &H2_transport)
return (NULL);
AZ(SES_Get_proto_priv(ctx->req->sp, &up));
Expand Down

0 comments on commit 0ecefa8

Please sign in to comment.