Fix bugs with browser responder.
Fix url>path so it doesn't double decode query parameters.cvs
parent
82e22a0841
commit
a3a1cf8a8c
|
@ -12,11 +12,18 @@ stdio streams strings threads url-encoding ;
|
||||||
drop stdio get
|
drop stdio get
|
||||||
] ifte ;
|
] ifte ;
|
||||||
|
|
||||||
: url>path ( uri -- path )
|
: (url>path) ( uri -- path )
|
||||||
url-decode "http://" ?str-head [
|
url-decode "http://" ?str-head [
|
||||||
"/" split1 dup "" ? nip
|
"/" split1 dup "" ? nip
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
|
: url>path ( uri -- path )
|
||||||
|
"?" split1 dup [
|
||||||
|
>r (url>path) "?" r> cat3
|
||||||
|
] [
|
||||||
|
drop (url>path)
|
||||||
|
] ifte ;
|
||||||
|
|
||||||
: secure-path ( path -- path )
|
: secure-path ( path -- path )
|
||||||
".." over str-contains? [ drop f ] when ;
|
".." over str-contains? [ drop f ] when ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue