From: Simon Chiang <simon.a.chiang@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Parsing non-nested requests
Date: Mon, 15 Jun 2009 21:43:59 -0700 (PDT) [thread overview]
Message-ID: <cb6e445a-a815-45d2-8ae7-cc93921006f5@p5g2000pre.googlegroups.com> (raw)
I have run into situations where I'd like to parse requests in an non-
nested fashion. Rack::Request almost lets you do this, but not
quite. I propose the changes in this commit:
http://github.com/bahuvrihi/rack/commit/fa29dc523a0994a85686b01a192d3ccbfb36c183
The commit refactors Rack::Request so that the parsing methods for
query strings and multipart data may be overridden. Then for non-
multipart data I think everything is fine; you would simply subclass
Request and call Utils.parse_query instead of
Utils.parse_nested_query.
Multipart data requires a little patch though because as far as I can
tell Multipart.parse_multipart parses nested queries and you can't get
around that. I also propose the changes in this commit:
http://github.com/bahuvrihi/rack/commit/d6a2a162651c8068822a9370fe66eeb709a5d69c
The commit adds a flag to parse_multipart to allow non-nested
parsing. The flag is a little inelegant, but at least it's backwards
compatible. A more elegant solution would be to have parse_multipart
and parse_nested_multipart, but that would be bad for anyone that
expects the current behavior.
Any thoughts?
reply other threads:[~2009-06-16 4:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://groups.google.com/group/rack-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb6e445a-a815-45d2-8ae7-cc93921006f5@p5g2000pre.googlegroups.com \
--to=rack-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).