aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-07-15 15:54:25 -0400
committerPaul Duncan <pabs@pablotron.org>2016-07-15 15:54:25 -0400
commite4c342e5995df16b5a0b0b5a0c3b542b75f821dc (patch)
tree5e8e935281cc1f2fd4ee377659c4e82be7489cec /src
parent689fe828d60fdeff8842e25cf081b04bcb06f9d3 (diff)
downloadguff-e4c342e5995df16b5a0b0b5a0c3b542b75f821dc.tar.bz2
guff-e4c342e5995df16b5a0b0b5a0c3b542b75f821dc.zip
add StubHandler (bad name)
Diffstat (limited to 'src')
-rw-r--r--src/guff.cr16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/guff.cr b/src/guff.cr
index 64c3b0e..9b5b952 100644
--- a/src/guff.cr
+++ b/src/guff.cr
@@ -2145,6 +2145,17 @@ module Guff
abstract def authenticated_call(context : HTTP::Server::Context)
end
+ class StubHandler < Handler
+ def call(context : HTTP::Server::Context)
+ STDERR.puts "%s %s" % [
+ context.request.method,
+ context.request.path.not_nil!
+ ]
+
+ call_next(context)
+ end
+ end
+
class SessionHandler < Handler
def call(context : HTTP::Server::Context)
# clear session
@@ -2596,6 +2607,9 @@ module Guff
HANDLERS = [{
:dev => true,
+ :id => :stub,
+ }, {
+ :dev => true,
:id => :error,
}, {
:dev => false,
@@ -2648,6 +2662,8 @@ module Guff
context : Context
) : HTTP::Handler
case handler_id
+ when :stub
+ StubHandler.new(context)
when :error
HTTP::ErrorHandler.new
when :log