You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2026/07/31 15:06:00 UTC
(tcl-rivet) branch master updated (a1c45fc -> 892e71c)
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
from a1c45fc Nice tabular form of the utf-8 to SGML entities map
new ed00ec0 fix bug in ::rivet::load_cookies
new 892e71c fix bug in ::rivet::load_cookies
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
ChangeLog | 10 +++++
rivet/default_request_handler.tcl | 6 ++-
rivet/rivet-tcl/cookie.tcl | 81 +++++++++++++++++++--------------------
rivet/rivet-tcl/load_cookies.tcl | 35 +++++++++++------
4 files changed, 77 insertions(+), 55 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org
(tcl-rivet) 02/02: fix bug in ::rivet::load_cookies
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 892e71c4ea5b49626987ca0e03f0b302311db95c
Merge: ed00ec0 a1c45fc
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Fri Jul 31 17:05:49 2026 +0200
fix bug in ::rivet::load_cookies
.asf.yaml | 14 ++++
ChangeLog | 4 ++
rivet/packages/entities/entities.tcl | 135 +++++++++++++++++------------------
3 files changed, 85 insertions(+), 68 deletions(-)
diff --cc ChangeLog
index 0273d60,b247b96..5b00c31
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,13 -1,7 +1,17 @@@
+2026-07-31 Massimo Manghi <mx...@apache.org>
+ * rivet/rivet-tcl/load_cookies.tcl: a cookie line separator
+ lies on the first occurence of character '=', but from that
+ position on the same character is a valid character for a
+ cookie value. Therefore command 'split' was fundamentally wrong
+ in that context
+
+2026-07-30 Massimo Manghi <mx...@apache.org>
+ * : released version in 'master' as 3.3.0
+
+ 2026-07-26 Massimo Manghi <mx...@apache.org>
+ * rivet/packages/entities/entities.tcl: utf-8 to entities map
+ nicely printed in tabular form
+
2026-07-11 Massimo Manghi <mx...@apache.org>
* src/mod_rivet_ng/mod_rivet_common.c: Now explicitly scoping in the
global namespace the array 'server' that ships some information about
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org
(tcl-rivet) 01/02: fix bug in ::rivet::load_cookies
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit ed00ec03b21fb0172463cd108a1816fe52f0672a
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Fri Jul 31 17:04:57 2026 +0200
fix bug in ::rivet::load_cookies
---
ChangeLog | 10 +++++
rivet/default_request_handler.tcl | 6 ++-
rivet/rivet-tcl/cookie.tcl | 81 +++++++++++++++++++--------------------
rivet/rivet-tcl/load_cookies.tcl | 35 +++++++++++------
4 files changed, 77 insertions(+), 55 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 42ae141..0273d60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-07-31 Massimo Manghi <mx...@apache.org>
+ * rivet/rivet-tcl/load_cookies.tcl: a cookie line separator
+ lies on the first occurence of character '=', but from that
+ position on the same character is a valid character for a
+ cookie value. Therefore command 'split' was fundamentally wrong
+ in that context
+
+2026-07-30 Massimo Manghi <mx...@apache.org>
+ * : released version in 'master' as 3.3.0
+
2026-07-11 Massimo Manghi <mx...@apache.org>
* src/mod_rivet_ng/mod_rivet_common.c: Now explicitly scoping in the
global namespace the array 'server' that ships some information about
diff --git a/rivet/default_request_handler.tcl b/rivet/default_request_handler.tcl
index e8a5e1c..32831b2 100644
--- a/rivet/default_request_handler.tcl
+++ b/rivet/default_request_handler.tcl
@@ -35,7 +35,11 @@
set script [::rivet::url_script]
if {$script ne ""} {
set ::Rivet::script $script
- namespace eval ::request $script
+ if {[file extension $script] eq ".tcl"} {
+ uplevel #0 $script
+ } else {
+ namespace eval ::request $script
+ }
}
set script [::rivet::inspect AfterScript]
diff --git a/rivet/rivet-tcl/cookie.tcl b/rivet/rivet-tcl/cookie.tcl
index b083db8..9ab7ad0 100644
--- a/rivet/rivet-tcl/cookie.tcl
+++ b/rivet/rivet-tcl/cookie.tcl
@@ -50,16 +50,16 @@ namespace eval ::rivet {
append cookieParams "; expires=[clock_to_rfc850_gmt $secs]"
}
}
- if { [info exists params(path)] } {
+ if {[info exists params(path)]} {
append cookieParams "; path=$params(path)"
}
- if { [info exists params(domain)] } {
+ if {[info exists params(domain)]} {
append cookieParams "; domain=$params(domain)"
}
- if { [info exists params(secure)] && $params(secure) == 1} {
+ if {[info exists params(secure)] && $params(secure) == 1} {
append cookieParams "; secure"
}
- if { [info exists params(HttpOnly)] && $params(HttpOnly)} {
+ if {[info exists params(HttpOnly)] && $params(HttpOnly)} {
append cookieParams "; HttpOnly"
}
@@ -77,48 +77,45 @@ namespace eval ::rivet {
set badchars "\[ \t;\]"
switch -- $cmd {
- "set" {
- set value [lindex $args 0]
- set args [lrange $args 1 end]
- import_keyvalue_pairs params $args
-
- if {[regexp $badchars $name]} {
- return -code error \
- "name may not contain semicolons, spaces, or tabs"
- }
- if {[regexp $badchars $value]} {
- return -code error \
- "value may not contain semicolons, spaces, or tabs"
- }
-
- set cookieKey "Set-Cookie"
- set cookieValue "$name=$value"
-
- append cookieValue [make_cookie_attributes params]
+ "set" {
+ set value [lindex $args 0]
+ set args [lrange $args 1 end]
+ import_keyvalue_pairs params $args
+
+ if {[regexp $badchars $name]} {
+ return -code error \
+ "name may not contain semicolons, spaces, or tabs"
+ }
+ if {[regexp $badchars $value]} {
+ return -code error \
+ "value may not contain semicolons, spaces, or tabs"
+ }
- headers add $cookieKey $cookieValue
- }
+ set cookieKey "Set-Cookie"
+ set cookieValue "$name=$value"
- "get" {
- ::request::global RivetCookies
+ append cookieValue [make_cookie_attributes params]
- if {![array exists RivetCookies]} { load_cookies RivetCookies }
- if {![info exists RivetCookies($name)]} { return }
- return $RivetCookies($name)
- }
+ headers add $cookieKey $cookieValue
+ }
+ "get" {
+ ::request::global RivetCookies
- "delete" {
- ## In order to delete a cookie, we just need to set a cookie
- ## with a time that has already expired.
- cookie set $name "" -minutes -1
- }
- "unset" {
- ::request::global RivetCookies
- if {![array exists RivetCookies]} { load_cookies RivetCookies }
- if {![info exists RivetCookies($name)]} { return }
- unset RivetCookies($name)
- }
+ if {![array exists RivetCookies]} { load_cookies RivetCookies }
+ if {![info exists RivetCookies($name)]} { return }
+ return $RivetCookies($name)
+ }
+ "delete" {
+ ## In order to delete a cookie, we just need to set a cookie
+ ## with a time that has already expired.
+ cookie set $name "" -minutes -1
+ }
+ "unset" {
+ ::request::global RivetCookies
+ if {![array exists RivetCookies]} { load_cookies RivetCookies }
+ if {![info exists RivetCookies($name)]} { return }
+ unset RivetCookies($name)
+ }
}
}
-
}
diff --git a/rivet/rivet-tcl/load_cookies.tcl b/rivet/rivet-tcl/load_cookies.tcl
index 61ce062..d6253fd 100644
--- a/rivet/rivet-tcl/load_cookies.tcl
+++ b/rivet/rivet-tcl/load_cookies.tcl
@@ -1,12 +1,14 @@
-###
-##
-## load_cookies - Read the cookies out of the web environment HTTP_COOKIE
-## variable, parse it, and store them as key-value pairs into the named
-## array.
-##
-## $Id$
-##
-###
+#
+# load_cookies - Read the cookies out of the web environment HTTP_COOKIE
+# variable, parse it, and store them as key-value pairs
+# into the named array.
+#
+# Implementing this command for tclwire's 'rivet' environment brough
+# up an inconsistency with the standards: The separator '=' falls in
+# the position of the character first occurrence. The character '='
+# is otherwise a valid character for a cookie value
+#
+#
namespace eval ::rivet {
@@ -17,9 +19,18 @@ namespace eval ::rivet {
foreach pair [split $HTTP_COOKIE ";"] {
set pair [split [string trim $pair] "="]
- set key [lindex $pair 0]
- set value [lindex $pair 1]
- set cookies($key) [list $value]
+ if {$pair eq {}} {
+ continue
+ }
+
+ set separator [string first = $pair]
+ if {$separator < 1} {
+ continue
+ }
+
+ set name [string trim [string range $pair 0 $separator-1]]
+ set value [string trim [string range $pair $separator+1 end]]
+ set cookies($name) [list $value]
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org