1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/hello-env.ru
Michael Grosser b548b624ea
restore environment to original state before restarting
- prevents apps from forever poisoning the ENV by doing bad things (something overrides PATH/HOME etc)
 - allows use of Dotenv to load new ENV settings from disk (they do not override)

Test:

```
puts "THIS SHOULD CHANGE #{ENV["TEST"] ||= rand.to_s}"
```

then restart the server
2017-04-10 12:05:33 -07:00

2 lines
118 B
Ruby

ENV["RAND"] ||= rand.to_s
run lambda { |env| [200, {"Content-Type" => "text/plain"}, ["Hello RAND #{ENV["RAND"]}"]] }