Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
thejhh committed Jun 3, 2012
1 parent 8d17b0a commit 3c683d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions backend.php
Expand Up @@ -14,6 +14,7 @@
if(isset($_GET['config'])) {
$server_time = time();
// Please note: Export only public information!
header("Content-Type: application/json");
echo json_encode(array(
'time' => $server_time,
'MAX_MSG_LENGTH' => MAX_MSG_LENGTH,
Expand Down
2 changes: 1 addition & 1 deletion main.php
Expand Up @@ -16,7 +16,7 @@ function output_error_object(array $data) {
$ident = ErrorIdentifier::get($data);
$json = json_encode($data);
writeln_stderr($ident . ' = ' . $json);
header("Content-Type: application/javascript");
header("Content-Type: application/json");
header("Status: 400 Bad Request");
echo json_encode(array('error' => 'Internal error with identifier ' . $ident)) . "\n";
exit;
Expand Down
4 changes: 3 additions & 1 deletion scripts/main.js
Expand Up @@ -274,7 +274,9 @@ require(["jquery", "moment", "bootstrap", "showdown"], function(jquery, moment,

// Setup SERVER_CONFIG
jquery.getJSON('/api/config.json', function(data){
SERVER_CONFIG = data;
jquery.each(data, function(key, val) {
SERVER_CONFIG[key] = val;
});
return fn(SERVER_CONFIG);
}).error(function() {
add_error("Failed to load server config");
Expand Down

0 comments on commit 3c683d4

Please sign in to comment.