-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass query and headers to application initialisation function
- Loading branch information
Showing
6 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
params←ParseQueryString query | ||
params←0 2⍴⊂'' | ||
→0⍴⍨0∊⍴query | ||
:If '='∊query ⍝ contains name=value? | ||
params←URLDecode¨2↑[2]↑'='(≠⊆⊢)¨'&'(≠⊆⊢)query | ||
:Else | ||
params←URLDecode query | ||
:EndIf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
r←URLDecode r;rgx;rgxu;i;j;z;t;m;⎕IO;lens;fill | ||
:Access public shared | ||
⍝ Decode a Percent Encoded string https://en.wikipedia.org/wiki/Percent-encoding | ||
⎕IO←0 | ||
((r='+')/r)←' ' | ||
rgx←'[0-9a-fA-F]' | ||
rgxu←'%[uU]',(4×⍴rgx)⍴rgx ⍝ 4 characters | ||
r←(rgxu ⎕R{{⎕UCS 16⊥⍉16|'0123456789ABCDEF0123456789abcdef'⍳⍵}2↓⍵.Match})r | ||
:If 0≠⍴i←(r='%')/⍳⍴r | ||
:AndIf 0≠⍴i←(i≤¯2+⍴r)/i | ||
z←r[j←i∘.+1 2] | ||
t←'UTF-8'⎕UCS 16⊥⍉16|'0123456789ABCDEF0123456789abcdef'⍳z | ||
lens←⊃∘⍴¨'UTF-8'∘⎕UCS¨t ⍝ UTF-8 is variable length encoding | ||
fill←i[¯1↓+\0,lens] | ||
r[fill]←t | ||
m←(⍴r)⍴1 ⋄ m[(,j),i~fill]←0 | ||
r←m/r | ||
:EndIf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
Initialise connected;r | ||
Initialise connected;r;m;demo | ||
|
||
→(EWC.MODE=0)⍴0 ⍝ Only in webby modes | ||
DemoMenu connected | ||
|
||
:If (≢_EWC.QUERY)≥i←_EWC.QUERY[;1]⍳⊂'Demo' | ||
demo←'Demo',⊃_EWC.QUERY[i;2] | ||
:AndIf 3=⎕NC demo | ||
demo CBRunDemo '' | ||
:Else | ||
DemoMenu connected | ||
:EndIf | ||
|
||
:If EWC.MODE=2 | ||
eDQ 'F1' | ||
:EndIf |