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

Reply via email to