Skip to content
Snippets Groups Projects
  1. Dec 21, 2018
  2. Nov 29, 2018
  3. Nov 19, 2018
    • João Távora's avatar
      Prepare docstrings for doc generation from docstrings · 4df4cbb5
      João Távora authored
      Also fix ridiculous indentation.
      
      * api.lisp (uri-to-arguments, arguments-to-uri)
      (read-for-resource, write-for-resource, handle-request)
      (documentation, backend-payload): Fix docstrings.
      
      * common.lisp (find-content-class, verb-spec-or-lose)
      (parse-resource, parse-content-type-header, check-optional-args)
      (genpath-fn-lambda-list, explain-failsafe): Fix indentation.
      (arguments-to-uri-1, uri-to-arguments-1, read-for-resource-1)
      (write-for-resource-1): Rename from ARGUMENTS-TO-URI,
      URI-TO-ARGUMENTS, READ-FOR-RESOURCE and WRITE-FOR-RESOURCE,
      respectively.
      4df4cbb5
  4. Jul 22, 2018
    • João Távora's avatar
      Close #11: Fix broken HTTP DELETE verb · 67e08376
      João Távora authored
      * common.lisp (destructive-p): DELETE is also a destructive verb.
      (handle-request-1): DELETE doesn't care about content-types
      
      * snooze-tests.lisp (:snooze-tests): import some symbols from
      snooze-tests-demo.
      (:snooze-tests-demo): Move package definition to top.
      (todo): Allow making TODO with given id.
      (with-request): Bind SNOOZE:*CATCH-ERRORS* and SNOOZE:*CATCH-HTTP-CONDITIONS*
      (todo :delete): New route
      (test-delete-route): New test
      (*mock-http-payload*): Move symbol to :SNOOZE-TESTS-DEMO
      67e08376
  5. Jan 09, 2018
    • João Távora's avatar
      Improve error reporting when *CATCH-ERRORS* is :VERBOSE · be998d12
      João Távora authored
      * common.lisp (resignalled-condition): Use a new slot
      ORIGINAL-CONDITION-BACKTRACE.
      (explain-failsafe): Improve text.
      (explain-failsafe unconvertible-argument): New method.
      (explain-failsafe :after): Print the "...when it was bitten by"
      here. Explain the original condition and the backtrace.
      
      * safe-simple-read.lisp (print-object :snooze-reader-error): New
      method.
      (safe-simple-read-from-string): Check for empty string.
      be998d12
    • João Távora's avatar
      Close #8: Don't mess with PRINT-OBJECT for RESIGNALLED-CONDITION, it's trouble · ff1f3bd4
      João Távora authored
      Customizations to PRINT-OBJECT for conditions affect every attempt to
      print these condition, which may lead to heap- and stack-exhausting
      errors when printing backtraces, for example. This is what was
      happening in issue #8.
      
      Better to have a separate method to provide the more human readable
      explanation and keep to using terse PRINT-UNREADABLE-OBJECT
      expressions in the PRINT-OBJECT methods.
      
      In the future, keep the original backtrace for the original condition
      of the resignalled condition as a string.
      
      * common.lisp (explain-condition-failsafe): Call a new internal
      generic function EXPLAIN-FAILSAFE.
      (resignalled-condition): Prepare to store backtrace of the
      original condition.
      (print-object http-condition): Use PRINT-UNREADABLE-OBJECT
      (print-object :after resignalled-condition): Delete.
      (print-object error-when-explaining, invalid-uri-structure)
      (incompatible-lambda-list): Delete these methods.
      (explain-failsafe): New methods to replace PRINT-OBJECT.
      ff1f3bd4
  6. Oct 08, 2017
  7. Oct 06, 2017
    • João Távora's avatar
      Use EQL to compare chars, not EQ · 59e28166
      João Távora authored
      Thanks to 'lispm' on reddit.
      
      * safe-simple-read.lisp (read-string, read-name, parse-symbol)
      (safe-simple-read-from-string): Use EQL to compare chars.
      59e28166
  8. Jun 05, 2017
  9. Oct 05, 2016
  10. Sep 19, 2016
    • João Távora's avatar
      Closes #4: Unbreak README example · 05eba93d
      João Távora authored
      The commit b1300e ("Resist more DOS keyword intern attacks") made the
      code too strict when deciding whether to intern symbols used for
      keyword arguments. This commit relaxes the fix, while still blocking
      that particular DOS.
      
      * common.lisp (uri-to-arguments): Be less strict when checking if
      symbols naming keyword arguments should be interned in the
      :KEYWORD package.
      05eba93d
  11. Jan 22, 2016
  12. Jan 20, 2016
  13. Jan 05, 2016
    • João Távora's avatar
      Resist more DOS keyword intern attacks · b1300ea2
      João Távora authored
      SNOOZE:URI-TO-ARGUMENTS is more careful when interning the keys in
      key-value pairs found in the URI as keyword arguments.
      
      It will only do so when a corresponding symbol with the same name is
      found in the resource's package. This heuristic should prevent abusive
      keyword interns.
      
      * common.lisp (resource-package): New helper.
      (uri-to-arguments): Be more careful when interning.
      (read-for-resource): Use RESOURCE-PACKAGE
      
      * snooze-tests.lisp (test-parse-uri): Explicitly intern BAR before
      testing.
      b1300ea2
  14. Aug 17, 2015
  15. Aug 16, 2015
  16. Aug 15, 2015
  17. Aug 14, 2015
  18. Aug 13, 2015
    • João Távora's avatar
      Fix SAFE-SIMPLE-READ-FROM-StrING · f1c2f059
      João Távora authored
      READER-ERROR doesn't take usual SIMPLE-ERROR args. (it does in Allegro though)
      
      * safe-simple-read.lisp (snooze-reader-error): New error
      condition.
      (read-string, parse-symbol)
      (safe-simple-read-from-string): Use it.
      f1c2f059
  19. Aug 12, 2015
    • João Távora's avatar
      SAFE-SIMPLE-READ-FROM-STRING may now make symbols if told so · dcc6e665
      João Távora authored
      * common.lisp (uri-to-arguments): Don't resignal if *CATCH-ERRORS*
      is nil. Fix indent.
      (read-for-resource): Don't check for errors here and pass t to
      SNOOZE-SAFE-SIMPLE-READ:SAFE-SIMPLE-READ-FROM-STRING.
      
      * safe-simple-read.lisp (parse-symbol): Return 4 values.
      (safe-simple-read-from-string): Take MAKE-SYMBOL-P. Update
      docstring.
      
      * snooze-tests.lisp (test-some-routes): Update test.
      (safe-simple-read-should-error): Update tests.
      (safe-simple-dont-read-back): Delete this test.
      dcc6e665
    • João Távora's avatar
      Don't use READ-FROM-STRING to parse URI by default · 92f625b9
      João Távora authored
      * api.lisp (read-for-resource): Update docstring.
      
      * common.lisp (read-for-resource): Use
      SNOOZE-SAFE-SIMPLE-READ:SAFE-SIMPLE-READ-FROM-STRING.
      
      * package.lisp: New package.
      
      * safe-simple-read.lisp: New file
      
      * snooze-tests.lisp (safe-simple-read-back)
      (safe-simple-dont-read-back, safe-simple-read-should-error): New tests
      
      * snooze.asd (:snooze): Depends on PARSE-FLOAT. Add
      "safe-simple-read".
      92f625b9
  20. Aug 11, 2015
    • João Távora's avatar
      Reorganize common.lisp · f2d9e13d
      João Távora authored
      * common.lisp (print-object): Move all PRINT-OBJECT for conditions nearer the conditions section.
      (*resource*): Fix a silly bug binding *RESOURCE* to a docstring.
      (default-resource-name, search-for-extension-content-type)
      (all-defined-resources, backend-payload): Group together as
      default implementation for options.
      (uri-to-arguments, arguments-to-uri, read-for-resource)
      (write-for-resource): Group together.
      f2d9e13d
    • João Távora's avatar
      Adapt tests to new default arg-reading rules · dcbe67f5
      João Távora authored
      * snooze-tests.lisp (#:snooze-parse-uri-tests): Don't use this package.
      (test-parse-uri, path-generation, path-parse-back): Adapt to new
      default argument-reading rules.
      dcbe67f5
    • João Távora's avatar
      Tweak README.md and the demo system · 05ecc8df
      João Távora authored
      05ecc8df
Loading