Pushed
https://github.com/cesanta/mongoose/commit/a3663da90eb09c7e65c8a6444423269e57af84eb
Robin: that push exposes mg_send_digest_auth_request().
Peer: that push also exports mg.request_info.content variable.
In lua, variable map could be built from mg.request_info.content by means
of this function:
-- Transforms string, e.g. 'aa=1&bb=2' into a map '{aa = 1, bb = 2}'
local parse_url_decoded_buffer = function(buf)
local map = {}
local decode = function(s)
s = s:gsub('+', ' ')
s = s:gsub('%%(%x%x)', function(h) return string.char(tonumber(h, 16))
end)
return s
end
buf:gsub('([^&=]+)=([^&=]*)&?',
function(key, value) map[decode(key)] = decode(value) end)
return map
end
On Sun, Jan 12, 2014 at 11:44 PM, Robin Gilks <[email protected]> wrote:
>
> >>
> >>
> >> That appears to work fine - I had to copy 'send_authorise' with changes
> >> to
> >> use the mg_connection rather than connection struct parameter to
> >> actually
> >> prompt the user for the username/password and that got it all working.
> >>
> >
> > Thanks Robin.
> > How about exposing send_authorize() too?
>
> Hmm - bit delayed by confusion over mg_printf still being exported where I
> should have been using mg_printf_data!! I also had to get the syntax for
> mg_send_header straight in my head!!
>
> Now I've got that problem sorted out, yes I agree that exposing
> send_authorize() would make a cleaner implementation.
>
> Cheers
>
> --
> Robin Gilks
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mongoose-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mongoose-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/groups/opt_out.