diff options
author | Simon Rettberg | 2019-01-15 14:30:51 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-01-15 14:30:51 +0100 |
commit | fe9e01b73fe398bd5c3c3a604a75686047b37bcc (patch) | |
tree | 8282d21993623828f071047a94c63c1807c2ba91 | |
parent | Merge branch 'master' into ipxe (diff) | |
parent | [dozmod] Re-allow old resources for migration (diff) | |
download | slx-admin-fe9e01b73fe398bd5c3c3a604a75686047b37bcc.tar.gz slx-admin-fe9e01b73fe398bd5c3c3a604a75686047b37bcc.tar.xz slx-admin-fe9e01b73fe398bd5c3c3a604a75686047b37bcc.zip |
Merge branch 'master' into ipxe
-rw-r--r-- | modules-available/dozmod/api.inc.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules-available/dozmod/api.inc.php b/modules-available/dozmod/api.inc.php index 74aaa003..c8139fbb 100644 --- a/modules-available/dozmod/api.inc.php +++ b/modules-available/dozmod/api.inc.php @@ -17,7 +17,7 @@ if (!Module::isAvailable('locations')) { define('LIST_URL', CONFIG_DOZMOD_URL . '/vmchooser/list'); define('VMX_URL', CONFIG_DOZMOD_URL . '/vmchooser/lecture'); -$availableRessources = ['list', 'vmx', 'test', 'netrules', 'runscript', 'netshares']; +$availableRessources = ['list', 'vmx', 'netrules', 'runscript', 'metadata']; /* BEGIN: A simple caching mechanism ---------------------------- */ @@ -216,6 +216,13 @@ function _getVmData($lecture_uuid, $subResource = false) /** Caching wrapper around _getVmData() **/ function outputResource($lecture_uuid, $resource) { + if ($resource === 'metadata') { + // HACK: config.tgz is compressed, don't use gzip output handler + @ob_end_clean(); + Header('Content-Type: application/gzip'); + } else { + Header('Content-Type: text/plain; charset=utf-8'); + } $key = $resource . '_' . $lecture_uuid; if (cache_has($key)) { cache_get_passthru($key); @@ -268,7 +275,8 @@ if ($resource === false) { } if (!in_array($resource, $availableRessources)) { - Util::traceError("unknown resource: $resource"); + Header('HTTP/1.1 400 Bad Request'); + die("unknown resource: $resource"); } $ip = $_SERVER['REMOTE_ADDR']; |