Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change how to use :identifier for matching. It is just an optional to…

… give a hint to match.
  • Loading branch information...
commit 8dab616b4a1cd5870b5ef75e0f01a564142927dc 1 parent 46723d7
Eitaro Fukamachi authored
Showing with 8 additions and 11 deletions.
  1. +8 −11 src/app.lisp
19 src/app.lisp
View
@@ -83,7 +83,7 @@
(let ((matched-rule
(find-if #'(lambda (rule)
(match-routing-rule-p rule string-url-rule method
- :identifier identifier))
+ :identifier identifier))
(routing-rules this))))
(if matched-rule
(routing-rule-controller matched-rule)
@@ -94,10 +94,10 @@
(setf (routing-rules this)
(delete-if #'(lambda (rule)
(match-routing-rule-p rule
- string-url-rule
- method
- :controller controller
- :identifier identifier))
+ string-url-rule
+ method
+ :controller controller
+ :identifier identifier))
(routing-rules this)))
(push (make-routing-rule (make-url-rule string-url-rule :method method)
@@ -123,12 +123,9 @@
(defmethod match-routing-rule-p ((rule routing-rule) string-url-rule method &key controller identifier)
(let ((url-rule (routing-rule-url-rule rule)))
- (if (or identifier (routing-rule-identifier rule))
- (eq identifier (routing-rule-identifier rule))
- (or (and controller
- (eq (routing-rule-controller rule) controller))
- (and (equal (clack.util.route::request-method url-rule) method)
- (string= (clack.util.route::url url-rule) string-url-rule))))))
+ (and (eq identifier (routing-rule-identifier rule))
+ (equal (clack.util.route::request-method url-rule) method)
+ (string= (clack.util.route::url url-rule) string-url-rule))))
(defun member-rule (path-info method rules &key allow-head)
(member-if #'(lambda (rule)
Please sign in to comment.
Something went wrong with that request. Please try again.