Many thanks, David, for figuring this out!
Many thanks, David, for figuring this out!
The change is incorporated in the nswebpush module on Bitbucket.
Against my own rules, I've updated the just released tar file for the
modules
naviserver-4.99.27-modules.tar.gz
to include this change.
all the best!
-g
On 09.08.23 12:19, David Osborne wrote:
Thanks Gustaf - replies inline...
On Wed, 9 Aug 2023 at 10:38, Gustaf Neumann <neum...@wu.ac.at> wrote:
Hi David,
We do not have nswebpush somewhere in production. Can you tell
more precisely, what "suddenly" means?
About lunchtime on 2nd Aug!
Does this mean, that you have not changed anything in your
environment, but google started to refuse it?
Yes exactly...
We've worked out what was angering Google - it was a version of this
code in our case:
https://bitbucket.org/naviserver/nswebpush/src/1e412c76626b29a4573b595a069a8ea10feece8a/webpush-procs.tcl#lines-607
Construction of the json from the claim dict was treating "exp" as a
string rather than numeric.
Just as an illustration, this quick hack makes the "make test" run
cleanly in the nswebpush codebase:
proc dictToJson {dict} {
#
# Serializes a Tcl dict to compact JSON. No testing for
# nested dicts or arrays, these will be simply added as a
# string the JSON is in compact form, meaning no whitespaces
# and newlines between keys/values.
set pairs {}
dict for {key value} $dict {
regsub -all \" $key "\\\"" key
regsub -all \" $value "\\\"" value
if { $key eq "exp"} {
lappend pairs [subst {"$key":$value}]
} else {
lappend pairs [subst {"$key":"$value"}]
}
}
return "{[join $pairs ,]}"
}
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Univ.Prof. Dr. Gustaf Neumann
Head of the Institute of Information Systems and New Media
of Vienna University of Economics and Business
Program Director of MSc "Information Systems"
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel