On Oct 26, 2010, at 7:50 PM, Björn Kalkbrenner wrote:

> I made a small "module" which just parses the HTTP_AUTHORIZATION and
> returns a table. It's not perfect code because i am a lua beginner but
> it can be used like that:

Thanks for sharing.

Perhaps your split function is a bit overkill if you just need to separate the 
authentication scheme from the credential. Maybe a simple match might suffice, 
e.g.:

local aScheme, aCredential = aHeader:match( '(%S+)%s(%S+)' )

Ditto for username and password:

local aUser, aPassword = base64( aCredential ):match( '(.*):(.*)' )

FWIW, here is Nanoki's auuthentication routine:

http://dev.alt.textdrive.com/browser/HTTP/HTTPExtra.lua#L98
_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to