مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
fix: fixes potential issue if machine hostname cannot be determined
هذا الالتزام موجود في:
@@ -26,7 +26,7 @@ class HealthServer
|
||||
private
|
||||
|
||||
def root
|
||||
[200, { "Content-Type" => "text/plain" }, ["#{@name} (pid: #{Process.pid}, host: #{Socket.gethostname})"]]
|
||||
[200, { "Content-Type" => "text/plain" }, ["#{@name} (pid: #{Process.pid}, host: #{hostname})"]]
|
||||
end
|
||||
|
||||
def ok
|
||||
@@ -43,6 +43,12 @@ class HealthServer
|
||||
[200, { "Content-Type" => "text/plain" }, [body]]
|
||||
end
|
||||
|
||||
def hostname
|
||||
Socket.gethostname
|
||||
rescue StandardError
|
||||
"unknown-hostname"
|
||||
end
|
||||
|
||||
class << self
|
||||
|
||||
def run(default_port: 9090, **options)
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم