# HG changeset patch # User Richard Schwab # Date 1608575344 -3600 # Node ID b0ad1604f77e35cd9aedb69ae45a19d039293c2b # Parent e8b9228b5265b06590236c4c3564e50014ecc9cb mod_http_upload_external: update php scripts to return HTTP 201 Created on upload diff -r e8b9228b5265 -r b0ad1604f77e mod_http_upload_external/share.php --- 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)) { diff -r e8b9228b5265 -r b0ad1604f77e mod_http_upload_external/share_v2.php --- a/mod_http_upload_external/share_v2.php Wed Dec 16 22:07:09 2020 +0100 +++ b/mod_http_upload_external/share_v2.php Mon Dec 21 19:29:04 2020 +0100 @@ -128,6 +128,11 @@ fclose($incoming_data); fclose($store_file); file_put_contents($store_file_name.'-type', $upload_file_type); + + // 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)) {