File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1515// Sending error code by default.
1616http_response_code (500 );
1717
18+ // Adjust trusted hosts settings to call health-check.php file from any host.
19+ putenv ("DRUPAL_TRUSTED_HOST= " . $ _SERVER ['SERVER_NAME ' ]);
20+
1821try {
1922 // Loading standard Drupal Kernel process.
2023 $ kernel = new DrupalKernel ('prod ' , $ autoloader );
3134 }
3235 else {
3336 $ stderr = fopen ('php://stderr ' , 'w ' );
34- fwrite ($ stderr ,print_r ($ _SERVER , 1 ) . "\n" );
37+ fwrite ($ stderr ,print_r ($ result , 1 ) . "\n" );
3538 fwrite ($ stderr ,print_r ($ response , 1 ) . "\n" );
3639 fclose ($ stderr );
3740 }
3841}
3942catch (\Exception $ exception ) {
4043 $ result = 'NOK ' . PHP_EOL ;
41- $ result = $ exception ->getMessage ();
44+ $ result . = $ exception ->getMessage ();
4245 $ fh = fopen ('php://stderr ' ,'w ' );
4346 fwrite ($ fh , $ result . "\n" );
4447 fclose ($ fh );
You can’t perform that action at this time.
0 commit comments