From 312b06a0e286704b49f330c33f822f7410bdfcfb Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 6 Dec 2023 14:59:52 -0500 Subject: [PATCH 1/5] -make-glob: url encode clay built globs This isn't supposed to work, but the check in the runtime is faulty. We fix it here for backwards compatiblity. --- desk/ted/make-glob.hoon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desk/ted/make-glob.hoon b/desk/ted/make-glob.hoon index b884bd2b..3e0312de 100644 --- a/desk/ted/make-glob.hoon +++ b/desk/ted/make-glob.hoon @@ -14,7 +14,12 @@ %+ turn paths |= pax=path ^- [path mime] - :- (slag (lent dir) pax) + :- + ?> ?=(^ pax) + %+ turn t.pax + |= seg=@t + ^- @t + (crip (en-urlt:html (trip seg))) =/ mar=mark (rear pax) =+ .^(vas=vase %cr (weld home pax)) =+ .^(=tube:clay %cc (weld home /[mar]/mime)) From 50fa744d5ce3961a39bf92db833c24f4c56a2adc Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 6 Dec 2023 15:00:48 -0500 Subject: [PATCH 2/5] %docket: handle both new and old url encoding cases Avoids having to force all third party developers to push new globs synchronously with this update. We simultaneously support unencoded and encoded paths by only url encoded if the unencoded path does not exist in the glob. --- desk/app/docket.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desk/app/docket.hoon b/desk/app/docket.hoon index ae435be7..b9af11ef 100644 --- a/desk/app/docket.hoon +++ b/desk/app/docket.hoon @@ -712,7 +712,8 @@ ?: =(suffix /desk/js) %- inline-js-response (rap 3 'window.desk = "' u.des '";' ~) - =. suffix (turn suffix |=(s=@t (crip (en-urlt:html (trip s))))) + =? suffix !(~(has by glob) suffix) + (turn suffix |=(s=@t (crip (en-urlt:html (trip s))))) =/ requested ?: (~(has by glob) suffix) suffix /index/html From 9689b802dd170bd6863e082a163a9cf89c7c8b5f Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Mon, 22 Jan 2024 16:16:55 -0500 Subject: [PATCH 3/5] docket: fix handling of multi-dot files --- desk/app/docket.hoon | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/desk/app/docket.hoon b/desk/app/docket.hoon index b9af11ef..810bf742 100644 --- a/desk/app/docket.hoon +++ b/desk/app/docket.hoon @@ -481,6 +481,8 @@ ++ handle-http-request |= [eyre-id=@ta inbound-request:eyre] ^- (quip card _state) + ~& authenticated/authenticated + ~& args/+< :: =; [payload=simple-payload:http caz=(list card) =_state] :_ state @@ -671,15 +673,17 @@ ++ split-at =| fst=tape |= [=tape char=@tD] + =. tape (flop tape) + |- ^+ [fst fst] - ?~ tape [fst tape] + ?~ tape [(flop fst) (flop tape)] ?: =(i.tape char) - [fst t.tape] + [(flop fst) (flop t.tape)] $(tape t.tape, fst (snoc fst i.tape)) :: ++ fip |= fil=@t - =/ [fil=tape ext=tape] (split-at (trip fil) '.') + =/ [ext=tape fil=tape] (split-at (trip fil) '.') =- (snoc - (crip ext)) %+ turn (scan fil (most fas (star ;~(less fas next)))) From adb321ae18442f4377014f9ce12d585cba943c58 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Tue, 23 Jan 2024 09:38:04 -0500 Subject: [PATCH 4/5] docket: fix sigpam --- desk/app/docket.hoon | 1 - 1 file changed, 1 deletion(-) diff --git a/desk/app/docket.hoon b/desk/app/docket.hoon index 810bf742..2eefca1f 100644 --- a/desk/app/docket.hoon +++ b/desk/app/docket.hoon @@ -482,7 +482,6 @@ |= [eyre-id=@ta inbound-request:eyre] ^- (quip card _state) ~& authenticated/authenticated - ~& args/+< :: =; [payload=simple-payload:http caz=(list card) =_state] :_ state From a8422fa5d4f6c1c941047a9c757ea20019cc61ca Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Tue, 30 Jan 2024 11:03:44 -0600 Subject: [PATCH 5/5] docket: remove errant log --- desk/app/docket.hoon | 1 - 1 file changed, 1 deletion(-) diff --git a/desk/app/docket.hoon b/desk/app/docket.hoon index 2eefca1f..9fd59d67 100644 --- a/desk/app/docket.hoon +++ b/desk/app/docket.hoon @@ -481,7 +481,6 @@ ++ handle-http-request |= [eyre-id=@ta inbound-request:eyre] ^- (quip card _state) - ~& authenticated/authenticated :: =; [payload=simple-payload:http caz=(list card) =_state] :_ state