Skip to content

Invalid URIs flood the log output with stack traces #8

@wnortje

Description

@wnortje

Invalid URLs (e.g. /index.php?s=/Index/\x5C) cause puri:uri-parse-error errors which Hunchentoot catches and then prints a stack trace to the log output. This quickly floods the log file when the app is open to the internet.

This code works around the problem

(defmethod hunchentoot:maybe-invoke-debugger ((condition puri:uri-parse-error))
  (call-next-method)
  (hunchentoot:log-message* :error "~A" condition)
  (setf (hunchentoot:return-code*) hunchentoot:+HTTP-BAD-REQUEST+)
  (hunchentoot:abort-request-handler))

A better solution is probably for easy-routes to catch these errors and convert them to Hunchentoot's native error class and then let Hunchentoot deal with them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions