Ketchup-0.3: docs/.git/COMMIT_EDITMSG
Updated docs to 0.3
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch gh-pages
# Your branch is up-to-date with 'origin/gh-pages'.
#
# Changes to be committed:
# new file: Ketchup-Auth.html
# modified: Ketchup-Httpd.html
# modified: Ketchup-Routing.html
# modified: Ketchup-Utils.html
# modified: doc-index.html
# modified: index-frames.html
# modified: index.html
# modified: main.txt
# new file: mini_Ketchup-Auth.html
# modified: mini_Ketchup-Routing.html
# modified: mini_Ketchup-Utils.html
#
# ------------------------ >8 ------------------------
# Do not touch the line above.
# Everything below will be removed.
diff --git a/Ketchup-Auth.html b/Ketchup-Auth.html
new file mode 100644
index 0000000..ff6a9f5
--- /dev/null
+++ b/Ketchup-Auth.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Auth</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_Ketchup-Auth.html");};
+//]]>
+</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Auth</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:basicAuth">basicAuth</a> ∷ [(ByteString, ByteString)] → ByteString → <a href="Ketchup-Httpd.html#t:Handler">Handler</a> → <a href="Ketchup-Httpd.html#t:Handler">Handler</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:basicAuth" class="def">basicAuth</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ [(ByteString, ByteString)]</td><td class="doc"><p>List of (Username, Password)
+</p></td></tr><tr><td class="src">→ ByteString</td><td class="doc"><p>Authentication Realm
+</p></td></tr><tr><td class="src">→ <a href="Ketchup-Httpd.html#t:Handler">Handler</a></td><td class="doc"><p>Success Handler
+</p></td></tr><tr><td class="src">→ <a href="Ketchup-Httpd.html#t:Handler">Handler</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Performs HTTP Basic Auth
+</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
\ No newline at end of file
diff --git a/Ketchup-Httpd.html b/Ketchup-Httpd.html
index b5c49f7..5c7dd67 100644
--- a/Ketchup-Httpd.html
+++ b/Ketchup-Httpd.html
@@ -1,14 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Httpd</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Ketchup-Httpd.html");};
//]]>
-</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Httpd</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:HTTPRequest">HTTPRequest</a> = <a href="#v:HTTPRequest">HTTPRequest</a> {<ul class="subs"><li><a href="#v:method">method</a> ∷ ByteString</li><li><a href="#v:uri">uri</a> ∷ ByteString</li><li><a href="#v:httpver">httpver</a> ∷ ByteString</li><li><a href="#v:headers">headers</a> ∷ <a href="Ketchup-Httpd.html#t:Headers">Headers</a></li><li><a href="#v:body">body</a> ∷ ByteString</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:Headers">Headers</a> = Map ByteString [ByteString]</li><li class="src short"><span class="keyword">type</span> <a href="#t:Handler">Handler</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → IO ()</li><li class="src short"><a href="#v:listenHTTP">listenHTTP</a> ∷ String → PortNumber → <a href="Ketchup-Httpd.html#t:Handler">Handler</a> → IO ()</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:HTTPRequest" class="def">HTTPRequest</a> </p><div class="doc"><p>HTTP Request type
+</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Httpd</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:HTTPRequest">HTTPRequest</a> = <a href="#v:HTTPRequest">HTTPRequest</a> {<ul class="subs"><li><a href="#v:method">method</a> ∷ ByteString</li><li><a href="#v:uri">uri</a> ∷ ByteString</li><li><a href="#v:httpver">httpver</a> ∷ ByteString</li><li><a href="#v:headers">headers</a> ∷ <a href="Ketchup-Httpd.html#t:Headers">Headers</a></li><li><a href="#v:body">body</a> ∷ ByteString</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:Headers">Headers</a> = [(ByteString, [ByteString])]</li><li class="src short"><span class="keyword">type</span> <a href="#t:Handler">Handler</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → IO ()</li><li class="src short"><a href="#v:listenHTTP">listenHTTP</a> ∷ String → PortNumber → <a href="Ketchup-Httpd.html#t:Handler">Handler</a> → IO ()</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:HTTPRequest" class="def">HTTPRequest</a> </p><div class="doc"><p>HTTP Request type
This holds a complete HTTP request
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:HTTPRequest" class="def">HTTPRequest</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:method" class="def">method</a> ∷ ByteString</dt><dd class="doc"><p>Get HTTP Request Method (GET, POST etc.)
</p></dd><dt class="src"><a name="v:uri" class="def">uri</a> ∷ ByteString</dt><dd class="doc"><p>Get Request URI
</p></dd><dt class="src"><a name="v:httpver" class="def">httpver</a> ∷ ByteString</dt><dd class="doc"><p>Get HTTP Version
</p></dd><dt class="src"><a name="v:headers" class="def">headers</a> ∷ <a href="Ketchup-Httpd.html#t:Headers">Headers</a></dt><dd class="doc"><p>Get HTTP Headers (header, [values])
</p></dd><dt class="src"><a name="v:body" class="def">body</a> ∷ ByteString</dt><dd class="doc"><p>Get HTTP Post body (raw string)
-</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:HTTPRequest" class="caption collapser" onclick="toggleSection('i:HTTPRequest')">Instances</p><div id="section.i:HTTPRequest" class="show"><table><tr><td class="src">Show <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Headers" class="def">Headers</a> = Map ByteString [ByteString]</p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Handler" class="def">Handler</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → IO ()</p></div><div class="top"><p class="src"><a name="v:listenHTTP" class="def">listenHTTP</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ String</td><td class="doc"><p>Address to bind (ie. <a href="*.html">*</a>)
+</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:HTTPRequest" class="caption collapser" onclick="toggleSection('i:HTTPRequest')">Instances</p><div id="section.i:HTTPRequest" class="show"><table><tr><td class="src">Show <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Headers" class="def">Headers</a> = [(ByteString, [ByteString])]</p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Handler" class="def">Handler</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → IO ()</p></div><div class="top"><p class="src"><a name="v:listenHTTP" class="def">listenHTTP</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ String</td><td class="doc"><p>Address to bind (ie. <a href="*.html">*</a>)
</p></td></tr><tr><td class="src">→ PortNumber</td><td class="doc"><p>Port to listen on
</p></td></tr><tr><td class="src">→ <a href="Ketchup-Httpd.html#t:Handler">Handler</a></td><td class="doc"><p>Route function to call
</p></td></tr><tr><td class="src">→ IO ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Listens for incoming HTTP request
diff --git a/Ketchup-Routing.html b/Ketchup-Routing.html
index c8298c8..6350f4f 100644
--- a/Ketchup-Routing.html
+++ b/Ketchup-Routing.html
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Routing</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Ketchup-Routing.html");};
//]]>
-</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Routing</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">type</span> <a href="#t:Route">Route</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → <a href="Ketchup-Routing.html#t:Parameters">Parameters</a> → IO ()</li><li class="src short"><span class="keyword">type</span> <a href="#t:Parameters">Parameters</a> = Map ByteString ByteString</li><li class="src short"><a href="#v:route">route</a> ∷ [(ByteString, <a href="Ketchup-Routing.html#t:Route">Route</a>)] → <a href="Ketchup-Httpd.html#t:Handler">Handler</a></li><li class="src short"><a href="#v:useHandler">useHandler</a> ∷ <a href="Ketchup-Httpd.html#t:Handler">Handler</a> → <a href="Ketchup-Routing.html#t:Route">Route</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Route" class="def">Route</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → <a href="Ketchup-Routing.html#t:Parameters">Parameters</a> → IO ()</p></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Parameters" class="def">Parameters</a> = Map ByteString ByteString</p></div><div class="top"><p class="src"><a name="v:route" class="def">route</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ [(ByteString, <a href="Ketchup-Routing.html#t:Route">Route</a>)]</td><td class="doc"><p>Routes
+</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Routing</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">type</span> <a href="#t:Route">Route</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → (ByteString → Maybe ByteString) → IO ()</li><li class="src short"><a href="#v:route">route</a> ∷ [(ByteString, <a href="Ketchup-Routing.html#t:Route">Route</a>)] → <a href="Ketchup-Httpd.html#t:Handler">Handler</a></li><li class="src short"><a href="#v:useHandler">useHandler</a> ∷ <a href="Ketchup-Httpd.html#t:Handler">Handler</a> → <a href="Ketchup-Routing.html#t:Route">Route</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Route" class="def">Route</a> = Socket → <a href="Ketchup-Httpd.html#t:HTTPRequest">HTTPRequest</a> → (ByteString → Maybe ByteString) → IO ()</p></div><div class="top"><p class="src"><a name="v:route" class="def">route</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ [(ByteString, <a href="Ketchup-Routing.html#t:Route">Route</a>)]</td><td class="doc"><p>Routes
</p></td></tr><tr><td class="src">→ <a href="Ketchup-Httpd.html#t:Handler">Handler</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Router function
Takes a list of routes and iterates through them for every requeust
</p></div></div><div class="top"><p class="src"><a name="v:useHandler" class="def">useHandler</a> ∷ <a href="Ketchup-Httpd.html#t:Handler">Handler</a> → <a href="Ketchup-Routing.html#t:Route">Route</a></p><div class="doc"><p>Wrap a handler in a route
diff --git a/Ketchup-Utils.html b/Ketchup-Utils.html
index d7b0897..0ef0bb4 100644
--- a/Ketchup-Utils.html
+++ b/Ketchup-Utils.html
@@ -1,9 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Utils</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Ketchup-Utils.html");};
//]]>
-</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Utils</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:trim">trim</a> ∷ ByteString → ByteString</li><li class="src short"><a href="#v:breakBS">breakBS</a> ∷ ByteString → ByteString → (ByteString, ByteString)</li><li class="src short"><a href="#v:parseBody">parseBody</a> ∷ ByteString → Map ByteString ByteString</li><li class="src short"><a href="#v:sendReply">sendReply</a> ∷ Socket → Int → [(ByteString, [ByteString])] → ByteString → IO ()</li><li class="src short"><a href="#v:sendBadRequest">sendBadRequest</a> ∷ Socket → IO ()</li><li class="src short"><a href="#v:sendNotFound">sendNotFound</a> ∷ Socket → IO ()</li><li class="src short"><a href="#v:statusMsg">statusMsg</a> ∷ Int → ByteString</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:trim" class="def">trim</a> ∷ ByteString → ByteString</p><div class="doc"><p>Trim whitespace from headers
+</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Ketchup.Utils</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:trim">trim</a> ∷ ByteString → ByteString</li><li class="src short"><a href="#v:breakBS">breakBS</a> ∷ ByteString → ByteString → (ByteString, ByteString)</li><li class="src short"><a href="#v:fallback">fallback</a> ∷ Maybe a → a → a</li><li class="src short"><a href="#v:parseBody">parseBody</a> ∷ ByteString → [(ByteString, ByteString)]</li><li class="src short"><a href="#v:sendReply">sendReply</a> ∷ Socket → Int → [(ByteString, [ByteString])] → ByteString → IO ()</li><li class="src short"><a href="#v:sendBadRequest">sendBadRequest</a> ∷ Socket → IO ()</li><li class="src short"><a href="#v:sendNotFound">sendNotFound</a> ∷ Socket → IO ()</li><li class="src short"><a href="#v:statusMsg">statusMsg</a> ∷ Int → ByteString</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:trim" class="def">trim</a> ∷ ByteString → ByteString</p><div class="doc"><p>Trim whitespace from headers
</p></div></div><div class="top"><p class="src"><a name="v:breakBS" class="def">breakBS</a> ∷ ByteString → ByteString → (ByteString, ByteString)</p><div class="doc"><p>ByteString breakSubstring wrapper that drops delimiters
-</p></div></div><div class="top"><p class="src"><a name="v:parseBody" class="def">parseBody</a> ∷ ByteString → Map ByteString ByteString</p><div class="doc"><p>Parse a URL-encoded Request
+</p></div></div><div class="top"><p class="src"><a name="v:fallback" class="def">fallback</a> ∷ Maybe a → a → a</p></div><div class="top"><p class="src"><a name="v:parseBody" class="def">parseBody</a> ∷ ByteString → [(ByteString, ByteString)]</p><div class="doc"><p>Parse a URL-encoded Request
</p></div></div><div class="top"><p class="src"><a name="v:sendReply" class="def">sendReply</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">∷ Socket</td><td class="doc"><p>Socket to write to
</p></td></tr><tr><td class="src">→ Int</td><td class="doc"><p>Status Code to send
</p></td></tr><tr><td class="src">→ [(ByteString, [ByteString])]</td><td class="doc"><p>HTTP headers (<a href="Header.html">Header</a>,[<a href="value1.html">value1</a>, <a href="value2.html">value2</a>])
diff --git a/doc-index.html b/doc-index.html
index ad296ab..e5dc6ab 100644
--- a/doc-index.html
+++ b/doc-index.html
@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title> (Index)</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();};
//]]>
-</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="index"><p class="caption">Index</p><table><tr><td class="src">body</td><td class="module"><a href="Ketchup-Httpd.html#v:body">Ketchup.Httpd</a></td></tr><tr><td class="src">breakBS</td><td class="module"><a href="Ketchup-Utils.html#v:breakBS">Ketchup.Utils</a></td></tr><tr><td class="src">chunk</td><td class="module"><a href="Ketchup-Chunked.html#v:chunk">Ketchup.Chunked</a></td></tr><tr><td class="src">chunkHeaders</td><td class="module"><a href="Ketchup-Chunked.html#v:chunkHeaders">Ketchup.Chunked</a></td></tr><tr><td class="src">endchunk</td><td class="module"><a href="Ketchup-Chunked.html#v:endchunk">Ketchup.Chunked</a></td></tr><tr><td class="src">Handler</td><td class="module"><a href="Ketchup-Httpd.html#t:Handler">Ketchup.Httpd</a></td></tr><tr><td class="src">Headers</td><td class="module"><a href="Ketchup-Httpd.html#t:Headers">Ketchup.Httpd</a></td></tr><tr><td class="src">headers</td><td class="module"><a href="Ketchup-Httpd.html#v:headers">Ketchup.Httpd</a></td></tr><tr><td class="src">HTTPRequest</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="Ketchup-Httpd.html#t:HTTPRequest">Ketchup.Httpd</a></td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="Ketchup-Httpd.html#v:HTTPRequest">Ketchup.Httpd</a></td></tr><tr><td class="src">httpver</td><td class="module"><a href="Ketchup-Httpd.html#v:httpver">Ketchup.Httpd</a></td></tr><tr><td class="src">listenHTTP</td><td class="module"><a href="Ketchup-Httpd.html#v:listenHTTP">Ketchup.Httpd</a></td></tr><tr><td class="src">method</td><td class="module"><a href="Ketchup-Httpd.html#v:method">Ketchup.Httpd</a></td></tr><tr><td class="src">Parameters</td><td class="module"><a href="Ketchup-Routing.html#t:Parameters">Ketchup.Routing</a></td></tr><tr><td class="src">parseBody</td><td class="module"><a href="Ketchup-Utils.html#v:parseBody">Ketchup.Utils</a></td></tr><tr><td class="src">Route</td><td class="module"><a href="Ketchup-Routing.html#t:Route">Ketchup.Routing</a></td></tr><tr><td class="src">route</td><td class="module"><a href="Ketchup-Routing.html#v:route">Ketchup.Routing</a></td></tr><tr><td class="src">sendBadRequest</td><td class="module"><a href="Ketchup-Utils.html#v:sendBadRequest">Ketchup.Utils</a></td></tr><tr><td class="src">sendNotFound</td><td class="module"><a href="Ketchup-Utils.html#v:sendNotFound">Ketchup.Utils</a></td></tr><tr><td class="src">sendReply</td><td class="module"><a href="Ketchup-Utils.html#v:sendReply">Ketchup.Utils</a></td></tr><tr><td class="src">static</td><td class="module"><a href="Ketchup-Static.html#v:static">Ketchup.Static</a></td></tr><tr><td class="src">statusMsg</td><td class="module"><a href="Ketchup-Utils.html#v:statusMsg">Ketchup.Utils</a></td></tr><tr><td class="src">trim</td><td class="module"><a href="Ketchup-Utils.html#v:trim">Ketchup.Utils</a></td></tr><tr><td class="src">uri</td><td class="module"><a href="Ketchup-Httpd.html#v:uri">Ketchup.Httpd</a></td></tr><tr><td class="src">useHandler</td><td class="module"><a href="Ketchup-Routing.html#v:useHandler">Ketchup.Routing</a></td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
\ No newline at end of file
+</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="index"><p class="caption">Index</p><table><tr><td class="src">basicAuth</td><td class="module"><a href="Ketchup-Auth.html#v:basicAuth">Ketchup.Auth</a></td></tr><tr><td class="src">body</td><td class="module"><a href="Ketchup-Httpd.html#v:body">Ketchup.Httpd</a></td></tr><tr><td class="src">breakBS</td><td class="module"><a href="Ketchup-Utils.html#v:breakBS">Ketchup.Utils</a></td></tr><tr><td class="src">chunk</td><td class="module"><a href="Ketchup-Chunked.html#v:chunk">Ketchup.Chunked</a></td></tr><tr><td class="src">chunkHeaders</td><td class="module"><a href="Ketchup-Chunked.html#v:chunkHeaders">Ketchup.Chunked</a></td></tr><tr><td class="src">endchunk</td><td class="module"><a href="Ketchup-Chunked.html#v:endchunk">Ketchup.Chunked</a></td></tr><tr><td class="src">fallback</td><td class="module"><a href="Ketchup-Utils.html#v:fallback">Ketchup.Utils</a></td></tr><tr><td class="src">Handler</td><td class="module"><a href="Ketchup-Httpd.html#t:Handler">Ketchup.Httpd</a></td></tr><tr><td class="src">Headers</td><td class="module"><a href="Ketchup-Httpd.html#t:Headers">Ketchup.Httpd</a></td></tr><tr><td class="src">headers</td><td class="module"><a href="Ketchup-Httpd.html#v:headers">Ketchup.Httpd</a></td></tr><tr><td class="src">HTTPRequest</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="Ketchup-Httpd.html#t:HTTPRequest">Ketchup.Httpd</a></td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="Ketchup-Httpd.html#v:HTTPRequest">Ketchup.Httpd</a></td></tr><tr><td class="src">httpver</td><td class="module"><a href="Ketchup-Httpd.html#v:httpver">Ketchup.Httpd</a></td></tr><tr><td class="src">listenHTTP</td><td class="module"><a href="Ketchup-Httpd.html#v:listenHTTP">Ketchup.Httpd</a></td></tr><tr><td class="src">method</td><td class="module"><a href="Ketchup-Httpd.html#v:method">Ketchup.Httpd</a></td></tr><tr><td class="src">parseBody</td><td class="module"><a href="Ketchup-Utils.html#v:parseBody">Ketchup.Utils</a></td></tr><tr><td class="src">Route</td><td class="module"><a href="Ketchup-Routing.html#t:Route">Ketchup.Routing</a></td></tr><tr><td class="src">route</td><td class="module"><a href="Ketchup-Routing.html#v:route">Ketchup.Routing</a></td></tr><tr><td class="src">sendBadRequest</td><td class="module"><a href="Ketchup-Utils.html#v:sendBadRequest">Ketchup.Utils</a></td></tr><tr><td class="src">sendNotFound</td><td class="module"><a href="Ketchup-Utils.html#v:sendNotFound">Ketchup.Utils</a></td></tr><tr><td class="src">sendReply</td><td class="module"><a href="Ketchup-Utils.html#v:sendReply">Ketchup.Utils</a></td></tr><tr><td class="src">static</td><td class="module"><a href="Ketchup-Static.html#v:static">Ketchup.Static</a></td></tr><tr><td class="src">statusMsg</td><td class="module"><a href="Ketchup-Utils.html#v:statusMsg">Ketchup.Utils</a></td></tr><tr><td class="src">trim</td><td class="module"><a href="Ketchup-Utils.html#v:trim">Ketchup.Utils</a></td></tr><tr><td class="src">uri</td><td class="module"><a href="Ketchup-Httpd.html#v:uri">Ketchup.Httpd</a></td></tr><tr><td class="src">useHandler</td><td class="module"><a href="Ketchup-Routing.html#v:useHandler">Ketchup.Routing</a></td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
\ No newline at end of file
diff --git a/index-frames.html b/index-frames.html
index 9de2c9d..8766065 100644
--- a/index-frames.html
+++ b/index-frames.html
@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();};
//]]>
-</script></head><body id="mini"><div id="module-list"><p class="caption">Modules</p><ul><li class="module"><a href="Ketchup-Chunked.html" target="main">Ketchup.Chunked</a></li><li class="module"><a href="Ketchup-Httpd.html" target="main">Ketchup.Httpd</a></li><li class="module"><a href="Ketchup-Routing.html" target="main">Ketchup.Routing</a></li><li class="module"><a href="Ketchup-Static.html" target="main">Ketchup.Static</a></li><li class="module"><a href="Ketchup-Utils.html" target="main">Ketchup.Utils</a></li></ul></div></body></html>
\ No newline at end of file
+</script></head><body id="mini"><div id="module-list"><p class="caption">Modules</p><ul><li class="module"><a href="Ketchup-Auth.html" target="main">Ketchup.Auth</a></li><li class="module"><a href="Ketchup-Chunked.html" target="main">Ketchup.Chunked</a></li><li class="module"><a href="Ketchup-Httpd.html" target="main">Ketchup.Httpd</a></li><li class="module"><a href="Ketchup-Routing.html" target="main">Ketchup.Routing</a></li><li class="module"><a href="Ketchup-Static.html" target="main">Ketchup.Static</a></li><li class="module"><a href="Ketchup-Utils.html" target="main">Ketchup.Utils</a></li></ul></div></body></html>
\ No newline at end of file
diff --git a/index.html b/index.html
index 75be0ea..0427491 100644
--- a/index.html
+++ b/index.html
@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();};
//]]>
-</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-list"><p class="caption">Modules</p><ul><li><span id="control.n.1" class="module collapser" onclick="toggleSection('n.1')">Ketchup</span><ul id="section.n.1" class="show"><li><span class="module"><a href="Ketchup-Chunked.html">Ketchup.Chunked</a></span></li><li><span class="module"><a href="Ketchup-Httpd.html">Ketchup.Httpd</a></span></li><li><span class="module"><a href="Ketchup-Routing.html">Ketchup.Routing</a></span></li><li><span class="module"><a href="Ketchup-Static.html">Ketchup.Static</a></span></li><li><span class="module"><a href="Ketchup-Utils.html">Ketchup.Utils</a></span></li></ul></li></ul></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
\ No newline at end of file
+</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-list"><p class="caption">Modules</p><ul><li><span id="control.n.1" class="module collapser" onclick="toggleSection('n.1')">Ketchup</span><ul id="section.n.1" class="show"><li><span class="module"><a href="Ketchup-Auth.html">Ketchup.Auth</a></span></li><li><span class="module"><a href="Ketchup-Chunked.html">Ketchup.Chunked</a></span></li><li><span class="module"><a href="Ketchup-Httpd.html">Ketchup.Httpd</a></span></li><li><span class="module"><a href="Ketchup-Routing.html">Ketchup.Routing</a></span></li><li><span class="module"><a href="Ketchup-Static.html">Ketchup.Static</a></span></li><li><span class="module"><a href="Ketchup-Utils.html">Ketchup.Utils</a></span></li></ul></li></ul></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
\ No newline at end of file
diff --git a/main.txt b/main.txt
index dab38cf..e8a9b10 100644
--- a/main.txt
+++ b/main.txt
@@ -10,9 +10,10 @@ trim :: ByteString -> ByteString
-- | ByteString breakSubstring wrapper that drops delimiters
breakBS :: ByteString -> ByteString -> (ByteString, ByteString)
+fallback :: Maybe a -> a -> a
-- | Parse a URL-encoded Request
-parseBody :: ByteString -> Map ByteString ByteString
+parseBody :: ByteString -> [(ByteString, ByteString)]
-- | Send a HTTP reply Sends a reply with the given parameters
sendReply :: Socket -> Int -> [(ByteString, [ByteString])] -> ByteString -> IO ()
@@ -46,16 +47,26 @@ headers :: HTTPRequest -> Headers
-- | Get HTTP Post body (raw string)
body :: HTTPRequest -> ByteString
-type Headers = Map ByteString [ByteString]
+type Headers = [(ByteString, [ByteString])]
type Handler = Socket -> HTTPRequest -> IO ()
-- | Listens for incoming HTTP request
listenHTTP :: String -> PortNumber -> Handler -> IO ()
instance Show HTTPRequest
+module Ketchup.Chunked
+
+-- | Send HTTP reply headers and begin a Chunked transmission
+chunkHeaders :: Socket -> Int -> [(ByteString, [ByteString])] -> IO ()
+
+-- | Sends a chunk
+chunk :: Socket -> ByteString -> IO ()
+
+-- | Send the final/closing chunk
+endchunk :: Socket -> IO ()
+
module Ketchup.Routing
-type Route = Socket -> HTTPRequest -> Parameters -> IO ()
-type Parameters = Map ByteString ByteString
+type Route = Socket -> HTTPRequest -> (ByteString -> Maybe ByteString) -> IO ()
-- | Router function Takes a list of routes and iterates through them for
-- every requeust
@@ -70,13 +81,7 @@ module Ketchup.Static
-- | Static file handler Takes a directory and returns a route
static :: ByteString -> Handler
-module Ketchup.Chunked
-
--- | Send HTTP reply headers and begin a Chunked transmission
-chunkHeaders :: Socket -> Int -> [(ByteString, [ByteString])] -> IO ()
-
--- | Sends a chunk
-chunk :: Socket -> ByteString -> IO ()
+module Ketchup.Auth
--- | Send the final/closing chunk
-endchunk :: Socket -> IO ()
+-- | Performs HTTP Basic Auth
+basicAuth :: [(ByteString, ByteString)] -> ByteString -> Handler -> Handler
diff --git a/mini_Ketchup-Auth.html b/mini_Ketchup-Auth.html
new file mode 100644
index 0000000..7015cd0
--- /dev/null
+++ b/mini_Ketchup-Auth.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Auth</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
+window.onload = function () {pageLoad();};
+//]]>
+</script></head><body id="mini"><div id="module-header"><p class="caption">Ketchup.Auth</p></div><div id="interface"><div class="top"><p class="src"><a href="Ketchup-Auth.html#v:basicAuth" target="main">basicAuth</a></p></div></div></body></html>
\ No newline at end of file
diff --git a/mini_Ketchup-Routing.html b/mini_Ketchup-Routing.html
index a33f00a..f8b79cf 100644
--- a/mini_Ketchup-Routing.html
+++ b/mini_Ketchup-Routing.html
@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Routing</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();};
//]]>
-</script></head><body id="mini"><div id="module-header"><p class="caption">Ketchup.Routing</p></div><div id="interface"><div class="top"><p class="src"><span class="keyword">type</span> <a href="Ketchup-Routing.html#t:Route" target="main">Route</a> </p></div><div class="top"><p class="src"><span class="keyword">type</span> <a href="Ketchup-Routing.html#t:Parameters" target="main">Parameters</a> </p></div><div class="top"><p class="src"><a href="Ketchup-Routing.html#v:route" target="main">route</a></p></div><div class="top"><p class="src"><a href="Ketchup-Routing.html#v:useHandler" target="main">useHandler</a></p></div></div></body></html>
\ No newline at end of file
+</script></head><body id="mini"><div id="module-header"><p class="caption">Ketchup.Routing</p></div><div id="interface"><div class="top"><p class="src"><span class="keyword">type</span> <a href="Ketchup-Routing.html#t:Route" target="main">Route</a> </p></div><div class="top"><p class="src"><a href="Ketchup-Routing.html#v:route" target="main">route</a></p></div><div class="top"><p class="src"><a href="Ketchup-Routing.html#v:useHandler" target="main">useHandler</a></p></div></div></body></html>
\ No newline at end of file
diff --git a/mini_Ketchup-Utils.html b/mini_Ketchup-Utils.html
index bfbd19d..cc746e2 100644
--- a/mini_Ketchup-Utils.html
+++ b/mini_Ketchup-Utils.html
@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ketchup.Utils</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();};
//]]>
-</script></head><body id="mini"><div id="module-header"><p class="caption">Ketchup.Utils</p></div><div id="interface"><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:trim" target="main">trim</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:breakBS" target="main">breakBS</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:parseBody" target="main">parseBody</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:sendReply" target="main">sendReply</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:sendBadRequest" target="main">sendBadRequest</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:sendNotFound" target="main">sendNotFound</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:statusMsg" target="main">statusMsg</a></p></div></div></body></html>
\ No newline at end of file
+</script></head><body id="mini"><div id="module-header"><p class="caption">Ketchup.Utils</p></div><div id="interface"><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:trim" target="main">trim</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:breakBS" target="main">breakBS</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:fallback" target="main">fallback</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:parseBody" target="main">parseBody</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:sendReply" target="main">sendReply</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:sendBadRequest" target="main">sendBadRequest</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:sendNotFound" target="main">sendNotFound</a></p></div><div class="top"><p class="src"><a href="Ketchup-Utils.html#v:statusMsg" target="main">statusMsg</a></p></div></div></body></html>
\ No newline at end of file