sirleech/Webduino — pull request #55 by m-mcgowan (2014-06-24 01:48:16+00:00)
Title: fixes for CRLF with favicon/robots.txt.

NB: Do not automatically merge this! You don't need all the changes in this pull request - I don't see a way to filter what gets sent with the request.

Here's what not to keep: any changes relating to SPARK_CORE you can ignore, since these are relevant only to the spark platform, not the arduino. Everything else can be considered for pulling into the main repo.

Here's my commit comment.

* Added writing of response also to serial so we can see the full conversation.
* Added the method unhandledCommand() which allows command handlers to fall back to the default error handler. (Say a command handler find's out the combination of request type or args means it cannot handle the command, it can call this method.)
* When splitting the url for the url handler, urls that end with a / previously had that final / removed. Since there is no way to know if the last path component had a / or not, we now keeps the final / if it has one.
* Fixed a bug in flow control in how illegal commands are handled (around line 624.). Previously, requests for robotsTxt and favicon would generator their content, followed by the http failure content.
* Fix inconsistency in how CRLF with extra headers were handled, and also ensured there is a double linefeed before the content body.