nitrogen / simple_bridge

A simple, standardized interface library to Erlang HTTP Servers.
MIT License
112 stars 76 forks source link

Fix header handling in mochiweb response. #21

Closed davidw closed 11 years ago

davidw commented 11 years ago

Fixes: https://github.com/nitrogen/simple_bridge/issues/20

evanmiller commented 11 years ago

I agree with this change, but note that the other bridge modules will need to be updated as well in order to present a consistent interface. It looks like the modules for Cowboy and Yaws also set a 10 year Expires header.

choptastic commented 11 years ago

Thanks David, I've got your commit pulled onto my development repo, and I've got a handful of refactoring tweaks for this (as well as working them into the other backend bridges, as Evan mentioned).

In particular, I'm adding an environment variable for a default expires header (only to be added if it doesn't already exist).

But this will make it onto mainline master in the next week or so.

Thanks again!

evanmiller commented 11 years ago

Any updates on this?

choptastic commented 11 years ago

Thanks for the poke.

This has been merged into mainline with a few tweaks. as described here: https://github.com/nitrogen/simple_bridge/commit/3c255e63c1d85ccbbfc729852631da7b930d1544

Basically, it will check for the expires header or a cache-control header, and if neither are found, it will look for the simple_bridge application variable default_expires.

There are three possibly values for this variable:

I hope that helps. This has been extended to the other backends as well.

evanmiller commented 11 years ago

Thanks, Jesse.

That commit says work in progress -- does master work as of the latest commits?

choptastic commented 11 years ago

I believe it does work, but I'm testing it now.

On Wed, Apr 24, 2013 at 5:35 PM, Evan Miller notifications@github.comwrote:

Thanks, Jesse.

That commit says work in progress -- does master work as of the latest commits?

— Reply to this email directly or view it on GitHubhttps://github.com/nitrogen/simple_bridge/pull/21#issuecomment-16976028 .

Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm

choptastic commented 11 years ago

master branch is good to go. Let me know if you run into any problems.

evanmiller commented 11 years ago

Thanks Jesse!