caveman
caveman copied to clipboard
nested query params throws quri.error exception with Woo
When running Hunchentoot, the association list is returned properly. However, when I switch the server for Woo, I hit an exception. I am running SBCL on OS X.
So:
/foo?bar=hello
returns ((bar . hello))
without problem, but /foo?foo[bar]=hello
throws an exception:
Callback Error: the message-complete callback failed
Callback Error: the message-complete callback failed
URI "/foo?foo[bar]=hello" contains an illegal character #\[ at position 13.
[Condition of type FAST-HTTP.ERROR:CB-MESSAGE-COMPLETE]
Restarts:
0: [ABORT] abort thread (#<THREAD "clack-handler-woo" RUNNING {100AE5B883}>)
Backtrace:
0: ((FLET #:HANDLER2232 :IN FAST-HTTP.PARSER::PARSE-BODY) #<unavailable argument>)
1: (SIGNAL #<QURI.ERROR:URI-MALFORMED-STRING {100664FB43}>)
2: (ERROR QURI.ERROR:URI-MALFORMED-STRING :DATA "/foo?foo[bar]=hello" :POSITION 13)
3: (QURI.PARSER::PARSE-QUERY-STRING #<unavailable argument> :START #<unavailable argument> :END #<unavailable argument>)
4: ((FLET QURI.PARSER::PARSE-FROM-PATH :IN QURI.PARSER::PARSE-URI-STRING) #<unavailable argument> #<unavailable argument>)
5: (QURI.PARSER::PARSE-URI-STRING #<unavailable argument> :START #<unavailable argument> :END #<unavailable argument>)
6: (WOO::HANDLE-REQUEST #S(FAST-HTTP.HTTP:HTTP-REQUEST :METHOD :GET :MAJOR-VERSION 1 :MINOR-VERSION 1 :STATUS 0 :CONTENT-LENGTH NIL :CHUNKED-P NIL ...) #S(WOO.EV.SOCKET:SOCKET :WATCHERS #(#.(SB-SYS:INT-S..
7: ((LAMBDA NIL :IN WOO::SETUP-PARSER))
8: ((LAMBDA (FAST-HTTP.HTTP:HTTP) :IN FAST-HTTP:MAKE-PARSER) #<unavailable argument>)
9: (FAST-HTTP.PARSER::PARSE-BODY #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument>)
10: (FAST-HTTP.PARSER:PARSE-REQUEST #<unavailable argument> #<unavailable argument> #<unavailable argument> :START #<unavailable argument> :END #<unavailable argument>)
11: ((LAMBDA (FAST-HTTP::DATA &KEY (FAST-HTTP::START 0) FAST-HTTP::END) :IN FAST-HTTP:MAKE-PARSER) #<unavailable argument> :START #<unavailable argument> :END #<unavailable argument>)
12: (WOO::READ-CB #S(WOO.EV.SOCKET:SOCKET :WATCHERS #(#.(SB-SYS:INT-SAP #X00300640) #.(SB-SYS:INT-SAP #X00300670) #.(SB-SYS:INT-SAP #X003006A0)) :LAST-ACTIVITY 1.44219061593897d9 :FD 7 :REMOTE-ADDR "127.0..
13: (WOO.EV.TCP::TCP-READ-CB #<unavailable argument> #.(SB-SYS:INT-SAP #X00300640) #<unavailable argument>)
14: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION) :IN "/Users/jack/.cache/common-lisp/sbcl-1.2.12-macosx-x64/Users/jack/quicklisp/dists/quicklisp/software/woo-20150804-git/src/ev/soc..
15: ("foreign function: call_into_lisp")
16: ("foreign function: funcall3")
17: ("foreign function: #x2010121C")
18: ("foreign function: #x300710")
19: ("foreign function: ev_run")
20: (LEV:EV-RUN #.(SB-SYS:INT-SAP #X00300710) 0)
21: ((FLET WOO::START-SERVER :IN WOO:RUN))
22: (WOO:RUN #<CLOSURE (LAMBDA (LACK.MIDDLEWARE.BACKTRACE::ENV) :IN "/Users/jack/quicklisp/dists/quicklisp/software/lack-20150709-git/src/middleware/backtrace.lisp") {100B35E1DB}> :DEBUG T :PORT 5000 :ADD..
23: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
24: ((FLET #:WITHOUT-INTERRUPTS-BODY-1182 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
25: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
26: ((FLET #:WITHOUT-INTERRUPTS-BODY-600 :IN SB-THREAD::CALL-WITH-MUTEX))
27: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {AA41CFB}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "..
28: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "clack-handler-woo" RUNNING {100AE5B883}> NIL #<CLOSURE (LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS) {100AE5B82B}> (#<S..
29: ("foreign function: call_into_lisp")
30: ("foreign function: new_thread_trampoline")
31: ("foreign function: _pthread_body")
32: ("foreign function: _pthread_body")
33: ("foreign function: thread_start")
What happens if you URL-encode the query keys?
Apologies for the long delay -- I haven't actually been able to reproduce this again, so I think this may have been user-error on my part. Closing the issue.
seeing the same problem with woo handler.
Callback Error: the message-complete callback failed
URI "/asklakslklas/obj[a]=2&obj[b]=3" contains an illegal character #\[ at position 17.
[Condition of type FAST-HTTP.ERROR:CB-MESSAGE-COMPLETE]
Restarts:
0: [ABORT] abort thread (#<THREAD "clack-handler-woo" RUNNING {1009F961E3}>)
Backtrace:
0: ((FLET #:H0 :IN FAST-HTTP.PARSER::PARSE-BODY) #<unavailable argument>)
1: (SIGNAL #<QURI.ERROR:URI-MALFORMED-STRING {100A8BA933}>)
2: (ERROR QURI.ERROR:URI-MALFORMED-STRING :DATA "/asklakslklas/obj[a]=2&obj[b]=3" :POSITION 17)
3: (QURI.PARSER::PARSE-PATH-STRING #<unavailable argument> :START #<unavailable argument> :END #<unavailable argument>)
4: ((FLET QURI.PARSER::PARSE-FROM-PATH :IN QURI.PARSER::PARSE-URI-STRING) #<unavailable argument> #<unavailable argument>)
5: (QURI.PARSER::PARSE-URI-STRING "/asklakslklas/obj[a]=2&obj[b]=3" :START #<unavailable argument> :END #<unavailable argument>)
6: (WOO::HANDLE-REQUEST #S(FAST-HTTP.HTTP:HTTP-REQUEST :METHOD :GET :MAJOR-VERSION 1 :MINOR-VERSION 1 :STATUS 0 :CONTENT-LENGTH NIL :CHUNKED-P NIL ...) #S(WOO.EV.SOCKET:SOCKET :WATCHERS #(#.(SB-SYS:INT-S..
7: ((LAMBDA NIL :IN WOO::SETUP-PARSER))