@@ -127,7 +127,7 @@ public static function json(mixed $data, int $status = 200, array $headers = [])
127127 }
128128
129129 $ headers ['Content-Type ' ] = 'application/json; charset=utf-8 ' ;
130- $ headers ['Date ' ] = gmdate (' D, d M Y H:i:s ' ). ' GMT ' ;
130+ $ headers ['Date ' ] = gmdate (DATE_RFC7231 ) ;
131131 return new static ($ json , $ status , $ headers );
132132 }
133133
@@ -137,7 +137,7 @@ public static function json(mixed $data, int $status = 200, array $headers = [])
137137 public static function html (string $ html , int $ status = 200 , array $ headers = []): static
138138 {
139139 $ headers ['Content-Type ' ] = 'text/html; charset=utf-8 ' ;
140- $ headers ['Date ' ] = gmdate (' D, d M Y H:i:s ' ). ' GMT ' ;
140+ $ headers ['Date ' ] = gmdate (DATE_RFC7231 ) ;
141141 return new static ($ html , $ status , $ headers );
142142 }
143143
@@ -147,7 +147,7 @@ public static function html(string $html, int $status = 200, array $headers = []
147147 public static function text (string $ text , int $ status = 200 , array $ headers = []): static
148148 {
149149 $ headers ['Content-Type ' ] = 'text/plain; charset=utf-8 ' ;
150- $ headers ['Date ' ] = gmdate (' D, d M Y H:i:s ' ). ' GMT ' ;
150+ $ headers ['Date ' ] = gmdate (DATE_RFC7231 ) ;
151151 return new static ($ text , $ status , $ headers );
152152 }
153153 /**
@@ -156,7 +156,7 @@ public static function text(string $text, int $status = 200, array $headers = []
156156 public static function file (string $ file , string $ filename , int $ status = 200 , array $ headers = []): static
157157 {
158158 $ headers ['Content-Type ' ] = 'application/octet-stream ' ;
159- $ headers ['Date ' ] = gmdate (' D, d M Y H:i:s ' ). ' GMT ' ;
159+ $ headers ['Date ' ] = gmdate (DATE_RFC7231 ) ;
160160 $ headers ['Content-Disposition ' ] = 'attachment; filename=" ' . $ filename . '" ' ;
161161 return new static (file_get_contents ($ file ), $ status , $ headers );
162162 }
0 commit comments