diff options
author | Matus Fabian <matfabia@cisco.com> | 2024-06-04 19:00:00 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2024-06-13 06:35:26 +0000 |
commit | 82ad9660becfcdd93c906d909d7e478733c5fbbe (patch) | |
tree | 9eb2615037a0e49d87ed73dc2ca8447eeeafc32c /src/plugins/builtinurl | |
parent | eaa7d91ad77f9c6691b42b0e9f631166b4bcf44f (diff) |
http: return more than url to server app
Provide all bytes as received from transport as data in the http
message to server. Additionally provide offset and length of target
path, target query, headers and body. Offers apis for parsing of
headers, percent decoding, target path/query syntax verification.
Type: improvement
Change-Id: Idbe6f13afa378650cc5212ea7d3f9319183ebbbe
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/builtinurl')
-rw-r--r-- | src/plugins/builtinurl/builtins.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/builtinurl/builtins.c b/src/plugins/builtinurl/builtins.c index b04e9dd5c7c..6a0975503a7 100644 --- a/src/plugins/builtinurl/builtins.c +++ b/src/plugins/builtinurl/builtins.c @@ -78,16 +78,14 @@ handle_get_interface_stats (hss_url_handler_args_t *args) vnet_interface_main_t *im = &vnm->interface_main; /* Get stats for a single interface via http POST */ - if (args->reqtype == HTTP_REQ_POST) + if (args->req_type == HTTP_REQ_POST) { - trim_path_from_request (args->request, "interface_stats.json"); - /* Find the sw_if_index */ - p = hash_get (im->hw_interface_by_name, args->request); + p = hash_get (im->hw_interface_by_name, args->req_data); if (!p) { s = format (s, "{\"interface_stats\": {[\n"); - s = format (s, " \"name\": \"%s\",", args->request); + s = format (s, " \"name\": \"%s\",", args->req_data); s = format (s, " \"error\": \"%s\"", "UnknownInterface"); s = format (s, "]}\n"); goto out; |