trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinr...@apache.org
Subject [trafficserver] branch master updated: Expose URL element methods through HTTPHdr (#7628)
Date Mon, 29 Mar 2021 13:14:40 GMT
This is an automated email from the ASF dual-hosted git repository.

shinrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new cd7fe0d  Expose URL element methods through HTTPHdr (#7628)
cd7fe0d is described below

commit cd7fe0d90d049e2d9b2ba189ae1e87166e222aa2
Author: Susan Hinrichs <shinrich@verizonmedia.com>
AuthorDate: Mon Mar 29 08:14:31 2021 -0500

    Expose URL element methods through HTTPHdr (#7628)
---
 proxy/hdrs/HTTP.h | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/proxy/hdrs/HTTP.h b/proxy/hdrs/HTTP.h
index 3da31a0..144255d 100644
--- a/proxy/hdrs/HTTP.h
+++ b/proxy/hdrs/HTTP.h
@@ -580,6 +580,27 @@ public:
   const char *path_get(int *length ///< Storage for path length.
   );
 
+  /** Get the URL matrix params.
+      This is a reference, not allocated.
+      @return A pointer to the matrix params or @c NULL if there is no valid URL.
+  */
+  const char *params_get(int *length ///< Storage for param length.
+  );
+
+  /** Get the URL query.
+      This is a reference, not allocated.
+      @return A pointer to the query or @c NULL if there is no valid URL.
+  */
+  const char *query_get(int *length ///< Storage for query length.
+  );
+
+  /** Get the URL fragment.
+      This is a reference, not allocated.
+      @return A pointer to the fragment or @c NULL if there is no valid URL.
+  */
+  const char *fragment_get(int *length ///< Storage for fragement length.
+  );
+
   /** Get the target host name.
       The length is returned in @a length if non-NULL.
       @note The results are cached so this is fast after the first call.
@@ -1312,6 +1333,27 @@ HTTPHdr::path_get(int *length)
 }
 
 inline const char *
+HTTPHdr::params_get(int *length)
+{
+  URL *url = this->url_get();
+  return url ? url->params_get(length) : nullptr;
+}
+
+inline const char *
+HTTPHdr::query_get(int *length)
+{
+  URL *url = this->url_get();
+  return url ? url->query_get(length) : nullptr;
+}
+
+inline const char *
+HTTPHdr::fragment_get(int *length)
+{
+  URL *url = this->url_get();
+  return url ? url->fragment_get(length) : nullptr;
+}
+
+inline const char *
 HTTPHdr::scheme_get(int *length)
 {
   URL *url = this->url_get();

Mime
View raw message