Skip to content

Commit

Permalink
Fix HTTP2 URL Decoding (#914)
Browse files Browse the repository at this point in the history
URL string in HTTP2 was not being properly decoded. Fixed to make the
decoding happen.
  • Loading branch information
pamaddox authored Aug 25, 2023
1 parent e22c595 commit 299998f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## 2.5

* Fix issue where the URL string on incoming HTTP2 requests was not being escaped properly.
* Fix issue where floated HTTP2 connections would resume before being triggered.

### 2.5.2
Expand Down
2 changes: 2 additions & 0 deletions src/mtev_http2.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ on_header_callback(nghttp2_session *session,
free(stream->req.uri_str);
stream->req.uri_str = mtev_strndup((const char *)value, valuelen);
mtev_http2_process_querystring(&stream->req);
inplace_urldecode(stream->req.uri_str);
} else if(HDR_NAME("host")) {
/* A host header cannot replace an :authority header */
void *dummy;
Expand Down Expand Up @@ -1320,6 +1321,7 @@ mtev_http1_http2_upgrade(mtev_http1_session_ctx *ctx) {
h2c->req.uri_str = strdup(mtev_http1_request_uri_str(req1));
}
mtev_http2_process_querystring(&h2c->req);
inplace_urldecode(h2c->req.uri_str);
h2c->req.method_str = strdup(mtev_http1_request_method_str(req1));
h2c->req.opts = mtev_http1_request_opts(req1) & ~MTEV_HTTP_CHUNKED;
h2c->req.opts |= MTEV_HTTP_CLOSE;
Expand Down

0 comments on commit 299998f

Please sign in to comment.