Re: [PATCH] DOC/MINOR: Suggestions for percent encoding in param()

2022-06-07 Thread Tim Düsterhus

Thayne,

this patch should be squashed with the previous 2/2 patch.

On 6/4/22 06:46, astrotha...@gmail.com wrote:

+  Note that this converter doesn't do anything special with url encoded 
characters. If
+  you want to decode the value, you can use the url_dec converter on the 
output. If
+  the name of the paramater in the input might contain encoded characters, 
you'll probably


There's a typo here: paramater


+  want do normalize the input before calling param. This can be done using


You should quote "param" here to indicate that it's a keyword. This also 
applies to urlp above (which is part of the 2/2 patch).


Best regards
Tim Düsterhus



[PATCH] DOC/MINOR: Suggestions for percent encoding in param()

2022-06-03 Thread astrothayne
From: Thayne McCombs 

Add some documentation on how to handle percent encoded characters in
input to the param() converter.
---
 doc/configuration.txt | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index d9f47c2eb..9505fc71d 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -17423,12 +17423,19 @@ param(,[])
   an alternative to `urlp()` which only uses "&" as a delimiter, whereas 
urlp
   also uses "?" and ";".

+  Note that this converter doesn't do anything special with url encoded 
characters. If
+  you want to decode the value, you can use the url_dec converter on the 
output. If
+  the name of the paramater in the input might contain encoded characters, 
you'll probably
+  want do normalize the input before calling param. This can be done using
+  "http-request normalize-uri", in particular the percent-decode-unreserved and
+  percent-to-uppercase options.
+
   Example :
   str(a=b=d=r),param(a)   # b
   str(a=c),param(a) # ""
   str(a==a),param(b)  # ""
   str(a=1;b=2;c=4),param(b,;) # 2
-  query,param(redirect_uri)
+  query,param(redirect_uri),urldec()

 protobuf(,[])
   This extracts the protocol buffers message field in raw mode of an input 
binary
--
2.36.1