lpereira / lwan

Experimental, scalable, high performance HTTP server
https://lwan.ws
GNU General Public License v2.0
5.94k stars 548 forks source link

307 Redirects #243

Closed HalosGhost closed 6 years ago

HalosGhost commented 6 years ago

301, though often used, can be really problematic. Mainly, it escapes all caching requirements: user-agents are allowed to indefinitely store 301s (so that refresh-without-cache can still see them).

As a result, having this be the only method of redirect available is unfortunate. At least, supporting 307 (like 301 but with standard caching and requires that the full request be repeated with the new URI—i.e., the request method cannot change) would be very nice.

lpereira commented 6 years ago

It's now possible to specify the code for redirects, but Lwan must know about it. In other words, if the code isn't known by Lwan (not every HTTP code is), it'll still silently use 301. To add a new code, add it to enum lwan_http_status, and add the appropriate entry in the lwan-tables.c file. PRs are welcome.

HalosGhost commented 6 years ago

This is awesome! I am particularly interested in 307 (as title mentions), shall I go ahead and add all the other redirects for completeness?

lpereira commented 6 years ago

Closing issue as fixed.