No middleware without touching RACK_ENV
Lin Jen-Shin (godfat)
godfat at godfat.org
Tue Jan 29 02:31:03 UTC 2013
On Tue, Jan 29, 2013 at 7:21 AM, Eric Wong <normalperson at yhbt.net> wrote:
> "Lin Jen-Shin (godfat)" <godfat at godfat.org> wrote:
>> Speaking to this, I might want to complain about the other severs :P
>> As far as I know, only if you use `rackup' would you get those middleware.
>> That is, `unicorn' is compatible with `rackup'. That's a good thing.
>> But it seems to me that both `thin' and `puma' (and maybe including
>> others, I didn't check) would not do this if you use their command line
>> tools. They even have different options to enable Rack::CommonLogger.
>> Actually this is also the reason why sometimes `thin' and `unicorn'
>> worked differently when people switching from Thin to Unicorn.
>> And you know a lot of people are using Thin in the first place,
>> thus sometimes blaming Unicorn works differently.
>> I am not sure how many people are using `rackup', but according to
>> my observation, not too much. If people are using Sinatra directly,
>> eventually they would launch the server via Rack::Handler.get.run,
>> which does not try to wrap additional middleware as what `rackup'
>> would do if I read correctly.
>> So I am not sure if a lot of people would be expecting this actually.
>> I used to use `rackup' a lot to get consistent behaviour, but it looks to
>> me not many people even know the existence of rackup :(
> *sigh* :<
> I kinda wish there was no default middleware, either. But it's
> too late to change unicorn defaults.
> I think your -N/--no-default-middleware patch can be accepted,
> then. after_app_load is more prone to user error/confusion, I think
> (I believe RAILS_ENV/RACK_ENV should be frozen for the lifetime of
> the process)
Awesome. Thanks! Hope this would also be helpful for others.
> Can you try send-email again with the --no-default-middleware patch? :)
> The git-send-email(1) manpage has several good examples for your email
> provider. There's also git-imap-send which you can use to stick email
> in your Drafts folder, but I've never needed/used it, though.
Just got managed to send a test mail to myself. I realized that my git is
using /usr/bin/perl instead of /usr/local/bin/perl, so that instead of running
`cpan Net::SMTP::SSL` I have to run `sudo -H /usr/bin/cpan Net::SMTP::SSL`
following instructions from this site:
I'll send the patch shortly after updating the commit message.
Feel free to edit it as usual :)
And should I send patches for rainbows and zbatery as well?
More information about the mongrel-unicorn