Ketchup 0.4.0 → 0.4.1
raw patch · 49 files changed
+34/−28 lines, 49 filesbinary-addedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- .git/COMMIT_EDITMSG +1/−15
- .git/ORIG_HEAD +1/−1
- .git/index binary
- .git/logs/HEAD +9/−0
- .git/logs/refs/heads/master +5/−0
- .git/logs/refs/remotes/origin/master +4/−0
- .git/objects/02/229886a2c1f7622014655936cde900885e9810 binary
- .git/objects/17/f0b2fcca6037579949bed0f62ed8508429855c binary
- .git/objects/20/0e8a1d9e64883c4442f155f3695cb99ecdb392 binary
- .git/objects/23/82296bb15427910f85a9a4a5be39677a6d9005 binary
- .git/objects/2b/a3de09ad5a0b0b58d543705380a9a44a31ae2b +1/−0
- .git/objects/33/126c8981c21f9755c7eaca90e81ca7d5d6fd62 binary
- .git/objects/62/25034f4b33110b1e1e8bb9938649989dcadc77 binary
- .git/objects/6d/9f02d0603a9cec81b119f36d16fdcfaebada1e binary
- .git/objects/8d/9c0ac2c94c7beeb8658183e131da7ce5effefb binary
- .git/objects/98/786dafc5b13181d5e4f6806a98124101fe317b binary
- .git/objects/9c/007b2a800ccd64ea6589e3aaf436dd386c5879 binary
- .git/objects/9c/39c23ffc9888f808ae093fdbd8ab7f27d175a2 +1/−0
- .git/objects/9e/312f7816623a831ed832285328746834e6886c binary
- .git/objects/ac/4473886e6ba9209e373ecacdf085588c79d527 binary
- .git/objects/ba/09adf09da69f7bd0411faa4beae8d28026eb7c binary
- .git/objects/c1/1eddba9f3bf52258e78eac875bb8d59575c4ef binary
- .git/objects/c3/ba3cdbd0c2f4fe371654b40c77b6d22dddc459 binary
- .git/objects/c9/1a524dd7612f6b6b1a10132e0315ee38c4e7ac binary
- .git/objects/ce/c17859d0a08acd01b9297297b32881bc4f7104 binary
- .git/objects/d5/02a059e60a1f025639da03678a15d54c4b3e78 binary
- .git/objects/d6/ef2f17034da6c0b06de2b23faea8f7240cf232 binary
- .git/refs/heads/master +1/−1
- .git/refs/remotes/origin/master +1/−1
- Ketchup.cabal +2/−2
- Ketchup.cabal~ +2/−5
- Ketchup/Auth.hi binary
- Ketchup/Auth.o binary
- Ketchup/Chunked.hi binary
- Ketchup/Chunked.o binary
- Ketchup/Httpd.hi binary
- Ketchup/Httpd.o binary
- Ketchup/Routing.hi binary
- Ketchup/Routing.hs +5/−1
- Ketchup/Routing.o binary
- Ketchup/Static.hi binary
- Ketchup/Static.o binary
- Ketchup/Utils.hi binary
- Ketchup/Utils.o binary
- README.md +1/−2
- example too large to diff
- example.core too large to diff
- example.hi binary
- example.o binary
@@ -1,15 +1,1 @@-Remove unneded comments-# Please enter the commit message for your changes. Lines starting-# with '#' will be ignored, and an empty message aborts the commit.-# On branch master-# Your branch is up-to-date with 'origin/master'.-#-# Changes to be committed:-# modified: Ketchup/Routing.hs-#-# Untracked files:-# .gitignore~-# Ketchup.cabal~-# example.core-# gendocs.sh~-#+Fix URL parsing to work with empty sections
@@ -1,1 +1,1 @@-85b4c8d2256c11c570cacf64895353c0b9bd374f+2382296bb15427910f85a9a4a5be39677a6d9005
binary file changed (1136 → 1136 bytes)
@@ -28,3 +28,12 @@ 694dea2e0fc5c15b1ef710cee6f953b1afb623bd 695dee0b1313795711418347aedd65f5bcbca02f Hamcha <zikyky@gmail.com> 1407086956 +0200 commit: Version bump for cabal 695dee0b1313795711418347aedd65f5bcbca02f 83ac9915be5493cf66f1f96de88b5edce6c39929 Hamcha <zikyky@gmail.com> 1407714950 +0200 commit: Doesn't work, but it's a start, will work on it tomorrow 83ac9915be5493cf66f1f96de88b5edce6c39929 85b4c8d2256c11c570cacf64895353c0b9bd374f Hamcha <zikyky@gmail.com> 1407715002 +0200 commit: Remove unneded comments+85b4c8d2256c11c570cacf64895353c0b9bd374f 9c007b2a800ccd64ea6589e3aaf436dd386c5879 Hamcha <zikyky@gmail.com> 1411050080 +0200 commit: Routing rewritten, now Regexp(tm) free+9c007b2a800ccd64ea6589e3aaf436dd386c5879 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050528 +0200 commit: Take "Regexp" out of docs+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050630 +0200 commit: Ehm+2382296bb15427910f85a9a4a5be39677a6d9005 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050635 +0200 rebase -i (start): checkout refs/remotes/origin/master+2382296bb15427910f85a9a4a5be39677a6d9005 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050635 +0200 rebase -i (finish): returning to refs/heads/master+2382296bb15427910f85a9a4a5be39677a6d9005 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050647 +0200 rebase -i (start): checkout HEAD~2+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050648 +0200 rebase -i (squash): Take "Regexp" out of docs+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050651 +0200 rebase -i (finish): returning to refs/heads/master+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b cec17859d0a08acd01b9297297b32881bc4f7104 Hamcha <zikyky@gmail.com> 1411488463 +0200 commit: Fix URL parsing to work with empty sections
@@ -28,3 +28,8 @@ 694dea2e0fc5c15b1ef710cee6f953b1afb623bd 695dee0b1313795711418347aedd65f5bcbca02f Hamcha <zikyky@gmail.com> 1407086956 +0200 commit: Version bump for cabal 695dee0b1313795711418347aedd65f5bcbca02f 83ac9915be5493cf66f1f96de88b5edce6c39929 Hamcha <zikyky@gmail.com> 1407714950 +0200 commit: Doesn't work, but it's a start, will work on it tomorrow 83ac9915be5493cf66f1f96de88b5edce6c39929 85b4c8d2256c11c570cacf64895353c0b9bd374f Hamcha <zikyky@gmail.com> 1407715002 +0200 commit: Remove unneded comments+85b4c8d2256c11c570cacf64895353c0b9bd374f 9c007b2a800ccd64ea6589e3aaf436dd386c5879 Hamcha <zikyky@gmail.com> 1411050080 +0200 commit: Routing rewritten, now Regexp(tm) free+9c007b2a800ccd64ea6589e3aaf436dd386c5879 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050528 +0200 commit: Take "Regexp" out of docs+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050630 +0200 commit: Ehm+2382296bb15427910f85a9a4a5be39677a6d9005 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050651 +0200 rebase -i (finish): refs/heads/master onto c91a524dd7612f6b6b1a10132e0315ee38c4e7ac+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b cec17859d0a08acd01b9297297b32881bc4f7104 Hamcha <zikyky@gmail.com> 1411488463 +0200 commit: Fix URL parsing to work with empty sections
@@ -25,3 +25,7 @@ 694dea2e0fc5c15b1ef710cee6f953b1afb623bd 695dee0b1313795711418347aedd65f5bcbca02f Hamcha <zikyky@gmail.com> 1407086961 +0200 update by push 695dee0b1313795711418347aedd65f5bcbca02f 83ac9915be5493cf66f1f96de88b5edce6c39929 Hamcha <zikyky@gmail.com> 1407714965 +0200 update by push 83ac9915be5493cf66f1f96de88b5edce6c39929 85b4c8d2256c11c570cacf64895353c0b9bd374f Hamcha <zikyky@gmail.com> 1407715015 +0200 update by push+85b4c8d2256c11c570cacf64895353c0b9bd374f 9c007b2a800ccd64ea6589e3aaf436dd386c5879 Hamcha <zikyky@gmail.com> 1411050084 +0200 update by push+9c007b2a800ccd64ea6589e3aaf436dd386c5879 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050533 +0200 update by push+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050656 +0200 update by push+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b cec17859d0a08acd01b9297297b32881bc4f7104 Hamcha <zikyky@gmail.com> 1411488467 +0200 update by push
binary file changed (absent → 884 bytes)
binary file changed (absent → 931 bytes)
binary file changed (absent → 321 bytes)
binary file changed (absent → 151 bytes)
@@ -0,0 +1,1 @@+xλj1 a×zÁÁ®+ .]¼Àh4k/kYËF8OmÒ»=ðq~nµNq»¾@0Æ£u£ËÖjYsJ6RL ©ð0¨ VytH8dC¹'|LbFgC)c¤èÙom U¾~§ù5¿Î×JÓýÈ~vÛGo"Ð ªmÝÒº¼ûGêfý§\ågÙC{vh#Æßê¡ZE_
binary file changed (absent → 208 bytes)
binary file changed (absent → 321 bytes)
binary file changed (absent → 706 bytes)
binary file changed (absent → 321 bytes)
binary file changed (absent → 955 bytes)
binary file changed (absent → 181 bytes)
@@ -0,0 +1,1 @@+xeMoÛ0w.ÐÿÀ5¥Aw@±a½µÝ!Ãz(ú1`T¶Z,i]7ÿ~¯ä$ 0")òá+×Ö×ôñìËçwZùAoç$Iç;KÓöáýñÑñÑnÍ^9n)uÊZZ=<ÜRâ.XîØãÝ>F¼Ù-ý²ò*Gçggtã¯I¼(û{Úª2oKã+Ý´§ÿf§NiFÕL*QçuoU$å4qW³Öª¶e'øÖs2kÚúå7ªVv±Ì´RiÃ(\ 0§> Ú yë~_IÝÖ%Y£B/dð¸l¢áFJ½×N÷ß!~0Ò^d|ºRÉ4ÛÕ´î])kdKÓo·?ÎÉ;pZûHΧ9àñîî|/Æ=<TTÇDSÃKzªz¯.¬ÕS¹ÏèR<¶¶ÊèÆåÉSF«K ë»ì¥¥)ƨ@ésÃ>ÏVIßSd¼Áîß¶<>L&ô;Í®1²í¡ej|ȯ÷Z"cÖFD@ÏÀ5§2ÚÆöÜv«+ÏyoycÑ6A,GQ ¿ ¤6?ø]·½Û°>]Åäãö¢?½yª(&#»öÖú!Ã.òâ´ÛþàÚ) $Í:ÓñB¶ÓlVøíýF;¯?/êpäÅydvI:³TtØûç9_ë»Àb$WééÞ©@4Úl°þÉÉküã®.çtŹ 4Ï W¦ÜÔÒû È+ò6e&5Ayn)pN¹W·ªBÚñ]£4såoÁ=îÃ_FKs
binary file changed (absent → 953 bytes)
binary file changed (absent → 616 bytes)
binary file changed (absent → 958 bytes)
binary file changed (absent → 319 bytes)
binary file changed (absent → 915 bytes)
binary file changed (absent → 169 bytes)
binary file changed (absent → 185 bytes)
binary file changed (absent → 208 bytes)
binary file changed (absent → 207 bytes)
@@ -1,1 +1,1 @@-85b4c8d2256c11c570cacf64895353c0b9bd374f+cec17859d0a08acd01b9297297b32881bc4f7104
@@ -1,1 +1,1 @@-85b4c8d2256c11c570cacf64895353c0b9bd374f+cec17859d0a08acd01b9297297b32881bc4f7104
@@ -1,5 +1,5 @@ Name: Ketchup -Version: 0.4.0 +Version: 0.4.1 Cabal-Version: >= 1.6 Build-Type: Simple License: MIT @@ -18,7 +18,7 @@ . * Basic httpd functionality (IPV4 only for now) . - * Regexp routing with parameters (ie. \`/user/:name/?\`) + * URL Routing with parameters (ie. \`/user/:name/\`) . * Static file handler (ie. \`static \".\"\` as route/handler) .
@@ -1,5 +1,5 @@ Name: Ketchup -Version: 0.3 +Version: 0.4.0 Cabal-Version: >= 1.6 Build-Type: Simple License: MIT @@ -18,7 +18,7 @@ . * Basic httpd functionality (IPV4 only for now) . - * Regexp routing with parameters (ie. \`/user/:name/(.\*)\`) + * URL Routing with parameters (ie. \`/user/:name/\`) . * Static file handler (ie. \`static \".\"\` as route/handler) . @@ -29,8 +29,6 @@ The core parts of Ketchup are all depedency free, that includes Ketchup.Httpd and Ketchup.Utils (and to a certain extent, Ketchup.Chunked). The dependencies required are for the following modules: . - * Ketchup.Routing (uses regex-pcre-builtin, This can ben modified to use builtin POSIX regexp) - . * Ketchup.Static (uses mime-types) . * Ketchup.Auth (uses base64-bytestring) @@ -57,7 +55,6 @@ directory <1.3, mime-types <0.2, network <2.5, - regex-pcre-builtin <1.0, text <2.0 Source-Repository head
binary file changed (absent → 1502 bytes)
binary file changed (absent → 12392 bytes)
binary file changed (absent → 1681 bytes)
binary file changed (absent → 13656 bytes)
binary file changed (absent → 2571 bytes)
binary file changed (absent → 42304 bytes)
binary file changed (absent → 2332 bytes)
@@ -17,6 +17,7 @@ type Matcher = B.ByteString -> (Bool, Arguments) data Arguments = None | Parameters [(B.ByteString, B.ByteString)] deriving Show + -- |Router function -- Takes a list of routes and iterates through them for every requeust route :: [(Matcher, Route)] -- ^ Routes @@ -30,12 +31,12 @@ params = snd matched matched = (fst r) (uri request) - -- |Wrap a handler in a route -- Lets you use a handler (no parameters) as a route useHandler :: Handler -> Route useHandler handler hnd req params = handler hnd req +-- |Create a matchable template with parameters (:param) match :: B.ByteString -> Matcher match template url = (isMatch, Parameters params) @@ -51,14 +52,17 @@ -> [(B.ByteString, B.ByteString)] -> (Bool, [(B.ByteString, B.ByteString)]) parse [] [] params = (True, params) +parse [""] [] params = (True, params) parse (u:url) [] params = (False, []) parse [] (t:temp) params = (False, []) parse (u:url) (t:temp) params | B.length t < 1 = parse url temp params + | B.length u < 1 = parse url (t:temp) params | B.head t == ':' = parse url temp ((B.tail t, u) : params) | u == t = parse url temp params | otherwise = (False, []) +-- |Create a prefix matcher prefix :: B.ByteString -> Matcher prefix urlPrefix url = (B.isPrefixOf urlPrefix url, None)
binary file changed (absent → 20128 bytes)
binary file changed (absent → 1990 bytes)
binary file changed (absent → 11208 bytes)
binary file changed (absent → 2218 bytes)
binary file changed (absent → 36072 bytes)
@@ -7,7 +7,7 @@ Currently Ketchup comes with: - Basic httpd functionality (IPV4 only for now) -- Regexp routing with parameters (ie. `/user/:name/(.\*)`) +- URL Routing with parameters (ie. `/user/:name/`) - Static file handler (ie. `static "."` as route/handler) - Basic Auth (please use it over a HTTPS reverse proxy) @@ -16,7 +16,6 @@ The core parts of Ketchup are all depedency free, that includes Ketchup.Httpd and Ketchup.Utils (and to a certain extent, Ketchup.Chunked). The dependencies required are for the following modules: -- Ketchup.Routing (uses **regex-pcre-builtin**, *This can ben modified to use builtin POSIX regexp*) - Ketchup.Static (uses **mime-types**) - Ketchup.Auth (uses **base64-bytestring**)
file too large to diff
file too large to diff
binary file changed (absent → 2970 bytes)
binary file changed (absent → 36760 bytes)