You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/01/23 21:35:27 UTC

[GitHub] [trafficserver] mlibbey opened a new issue #7442: header_rewrite doc bug for %{RANDOM}

mlibbey opened a new issue #7442:
URL: https://github.com/apache/trafficserver/issues/7442


   https://docs.trafficserver.apache.org/en/8.0.x/admin-guide/plugins/header_rewrite.en.html#random
   says
   RANDOM
   cond %{RANDOM:<n>} <operand>
   Generates a random integer between 0 and <n>, inclusive.
   
   When I configure using 
   cond %{SEND_RESPONSE_HDR_HOOK}
       set-header Random %{RANDOM:3}
   I never see 3 as an answer:
   $ for i in $(seq 100); do curl -IXGET http://127.0.0.1/ | grep Random >> /tmp/x; done; sort /tmp/x | uniq -c | sort -nr
        37 Random: 0
        35 Random: 2
        28 Random: 1
   
   Think we need to change doc to say 
   Generates a random integer from 0 to <n>, eg, [0,<n>) -- <n> will not appear.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bneradt commented on issue #7442: header_rewrite doc bug for %{RANDOM}

Posted by GitBox <gi...@apache.org>.
bneradt commented on issue #7442:
URL: https://github.com/apache/trafficserver/issues/7442#issuecomment-1009494570


   Thanks Miles for filing this. Looks like this has been updated. See:
   https://docs.trafficserver.apache.org/en/8.1.x/admin-guide/plugins/header_rewrite.en.html#random
   
   > Generates a random integer from 0 up to (but not including) \<n\>. Mathmatically, [0,n) or 0 <= r < n.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on issue #7442: header_rewrite doc bug for %{RANDOM}

Posted by GitBox <gi...@apache.org>.
bryancall commented on issue #7442:
URL: https://github.com/apache/trafficserver/issues/7442#issuecomment-1009494095


   The docs have been updated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] masaori335 commented on issue #7442: header_rewrite doc bug for %{RANDOM}

Posted by GitBox <gi...@apache.org>.
masaori335 commented on issue #7442:
URL: https://github.com/apache/trafficserver/issues/7442#issuecomment-767186919


   Comment on the `ConditionRandom` says
   https://github.com/apache/trafficserver/blob/f7bdee616ebec26b2746ce50c75eaacab7571554/plugins/header_rewrite/conditions.cc#L110


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] masaori335 commented on issue #7442: header_rewrite doc bug for %{RANDOM}

Posted by GitBox <gi...@apache.org>.
masaori335 commented on issue #7442:
URL: https://github.com/apache/trafficserver/issues/7442#issuecomment-767186919


   Comment on the `ConditionRandom` says
   https://github.com/apache/trafficserver/blob/f7bdee616ebec26b2746ce50c75eaacab7571554/plugins/header_rewrite/conditions.cc#L110


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall closed issue #7442: header_rewrite doc bug for %{RANDOM}

Posted by GitBox <gi...@apache.org>.
bryancall closed issue #7442:
URL: https://github.com/apache/trafficserver/issues/7442


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org