مراية لـ
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
|
private
|
||||||
|
|
||||||
def root
|
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
|
end
|
||||||
|
|
||||||
def ok
|
def ok
|
||||||
@@ -43,6 +43,12 @@ class HealthServer
|
|||||||
[200, { "Content-Type" => "text/plain" }, [body]]
|
[200, { "Content-Type" => "text/plain" }, [body]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def hostname
|
||||||
|
Socket.gethostname
|
||||||
|
rescue StandardError
|
||||||
|
"unknown-hostname"
|
||||||
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
def run(default_port: 9090, **options)
|
def run(default_port: 9090, **options)
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم