1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

17 commits

Author SHA1 Message Date
Eileen M. Uchitelle
01699742a8 Add early hints feature (#1403)
This commit adds the early hints lambda to the headers hash. Users can
call it to emit the early hints headers. For example:

```
class Server
  def call env
    if env["REQUEST_PATH"] == "/"
      env['rack.early_hints'].call("Link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload")
      [200, { "X-Hello" => "World" }, ["Hello world!"]]
    else
      [200, { "X-Hello" => "World" }, ["NEAT!"]]
    end
  end
end

run Server.new
```

In this example, the server sends stylesheet and javascript early hints
if the proxy supports it, it will send H2 pushes to the client.

Of course not every proxy server supports early hints, so to enable the
early hints feature with puma you have to pass the configuration variable,
`--early-hints`.

If `ENV['rack.early_hints']` is not set then early hints is not
supported by the webserver. Early hints is off by default.
2017-10-04 06:30:16 -06:00
Ahmed El-Masry
1b5d5b534a Don't use Dir.exists? as it's deprecated and use Dir.exist? instead (#1294) 2017-05-15 05:40:29 -07:00
Manabu Ejima
2deefc5452 Raise error when stdout or stderr is not writable 2016-12-15 01:45:10 +09:00
Evan Phoenix
5fdf337790 Move puma.rb to just autoloads. Fixes #1063 2016-09-05 11:29:16 -07:00
Evan Phoenix
eb6468d558 Handle HUP as a stop unless there is IO redirection. Fixes #911 2016-07-24 15:24:42 -07:00
Evan Phoenix
2982fb396e Show RUBY_ENGINE_VERSION if available. Fixes #923 2016-03-05 21:48:44 -08:00
Evan Phoenix
f788af0c8f Continue API cleanup, preparing for 3.0 2016-02-06 19:00:29 -08:00
Ben Osheroff
8356182079 allow umask for unix:/// style control urls
this lets us rely on unix permissions to control access to the
control_url.
2016-01-15 09:32:04 -08:00
Alex Chaffee
855d98622b better error logging during startup
When puma is daemonized (or maybe always?) it swallows exceptions that happen during startup. This patch makes the log message slightly more useful.

Should we log the entire stacktrace too? Clutter vs. info...
2014-09-16 09:29:31 -04:00
Evan Phoenix
99e6fd19dc Show the ruby version in use 2014-01-25 14:26:59 -08:00
Evan Phoenix
4ea35190ec Add experimental tcp mode (aka lopez express mode) 2013-08-07 16:39:08 -07:00
Evan Phoenix
816c67d2e9 Add ability to drain accept socket on shutdown 2013-07-15 14:29:10 -07:00
Evan Phoenix
c68ea5e46b Move starting control server to after daemonization 2013-07-08 22:36:50 -07:00
Evan Phoenix
9338e50499 Bump to 2.3.0 2013-07-05 22:16:46 -07:00
Evan Phoenix
e70a370e2d More cleanup 2013-07-05 21:13:29 -07:00
Evan Phoenix
f2e11d1b52 A bit more cleanup 2013-07-05 17:09:18 -07:00
Evan Phoenix
c48b804d8f Refactor modes, fix control server to always work 2013-07-05 16:08:13 -07:00