Skip to content

Commit

Permalink
New serialization scheme to avoid mismatches from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
midsum-salrux committed Oct 13, 2023
1 parent cf1620a commit fe1d88b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions desk/app/genuine.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
++ give-payload
|= [id=@ta =simple-payload:http]
(give-simple-payload:app:server id simple-payload)
:: without removing the dots, there are intermittent mismatches when reading
:: the secret from the URL
++ serialize
|= eny=@uvJ
%- crip
%+ skip (trip (scot %uw eny))
|= =cord
=(cord '.')
+$ card card:agent:gall
+$ versioned-state
$% state-0
Expand Down Expand Up @@ -42,9 +50,7 @@
=/ line i.t.site.full-line
?+ method.request (give-payload id not-found:gen:server)
%'GET'
~& ["from URL" line]
~& ["from state" (scot %uw secret)]
(give-payload id (json-response:gen:server b+=(line (scot %uw secret))))
(give-payload id (json-response:gen:server b+=(line (serialize secret))))
==
==
::
Expand Down Expand Up @@ -84,6 +90,6 @@
|= =path
^- (unit (unit cage))
?+ path [~ ~]
[%x %secret ~] ``json+!>([%s (scot %uw secret)])
[%x %secret ~] ``json+!>([%s (serialize secret)])
==
--

0 comments on commit fe1d88b

Please sign in to comment.