-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace LWS with a single SP in header values #224
Conversation
replace LWS with a single SP in header values
OK, merged. Did we need the URI->new stuff for Location when replacing LWS with SP is sufficient? |
Query parameters in URI should be percent encoded before And, we can't recognize whether we should pass percent encoded parameters or not from the documentation of If we omit this process, I expect framework developers should implement the same code. |
That's fine, because you've given an invalid URI in the first place. What is more important here is to not generate invalid PSGI headers (because newlines in header values is invalid in PSGI), rather than not generate invalid URI.
Yeah, but then we could better just kill the redirect() and location() method instead altogether. I really, really hate to put framework-like code inside Plack, and this is why I separated the Plack::Request and Response from the core dist, and then writing middleware becomes kind of painful, so i merged it back, but i guess it's time to do it again. sigh |
Fair point, but is it then also not obvious (or at least, undocumented either) where: |
I honestly don't believe it. Let's say we have a
To me it does sound a little weird, or at least inconsistent, that only the You're right that most frameworks need to implement the method to abstract this, but I'm sure it would be different from
I confirmed this with Catalyst - Catalyst::Response doesn't really special-case |
I agree. You convinced me that you are right.
I think that deleting redirect() and location() methods is not so bad substitution if you hate to put framework-like code. |
Great that we found an agreement :) I added a note to make the documentation less confusing just in case. Just for the note: the current code still makes a room for developers to give invalid URI to the Location field, but it's totally fine - you can also give non-integer value to Content-Length, or invalid MIME type to Content-Type, and so on - it is not Plack::Response's responsibility to validate them. |
Yep, that's fine :) |
Changelog diff is: diff --git a/Changes b/Changes index 6ed82dd..f57496c 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,29 @@ Revision history for Perl extension Plack Take a look at http://github.com/miyagawa/Plack/issues for the planned changes before 1.0 release. +0.9981 Mon Jul 18 17:24:11 PDT 2011 + [BUG FIXES] + - Plack::Request: Added a sanity check to remove newlines from headers to follow + the PSGI specification #224 + - HTTPParser::PP: Fixed warnings #225 + - plackup now prints errors to psgi.errors rather than STDERR + - Fixes issues with undef returned from streaming handler in middleware #231 + - ContentLength: Do not auto-add Content-Length from block devices, pipes and + character files + + [NEW FEATURES] + - HTTPExceptions: Support ->as_psgi method on exceptions (doy) + - FastCGI: Support psgix.harakiri + + [IMPROVEMENTS] + - Lint: Added more checks to validate header values + - StackTrace: Strip caller information since it is not useful anyway + - HTTPExceptions: Added rethrow option (doy) + - Misc. doc fixes on plackup (chromatic) + - binmode STDIN for CGI handler for Win32 #218 + - Remove the test that tests Server specific handling of Transfer-Encoding + - Fixed POD link (audreyt) + 0.9980 Mon Jun 6 20:24:25 PDT 2011 [BUG FIXES] - Fixed a bug where restarting loader doesn't terminate children (#209)
:)