Mercurial > prosody-modules
diff mod_http_upload_external/share.php @ 4310:b0ad1604f77e
mod_http_upload_external: update php scripts to return HTTP 201 Created on upload
author | Richard Schwab <hgprosodyim-lawrpxz9uw@central-intelligence.agency> |
---|---|
date | Mon, 21 Dec 2020 19:29:04 +0100 |
parents | 62c82d097017 |
children |
line wrap: on
line diff
--- a/mod_http_upload_external/share.php Wed Dec 16 22:07:09 2020 +0100 +++ b/mod_http_upload_external/share.php Mon Dec 21 19:29:04 2020 +0100 @@ -113,6 +113,11 @@ /* Close the streams */ fclose($incoming_data); fclose($store_file); + + // https://xmpp.org/extensions/xep-0363.html#upload + // A HTTP status Code of 201 means that the server is now ready to serve the file via the provided GET URL. + header('HTTP/1.0 201 Created'); + exit; } else if($request_method === 'GET' || $request_method === 'HEAD') { // Send file (using X-Sendfile would be nice here...) if(file_exists($store_file_name)) {