diff options
author | Andrew Dolgov <[email protected]> | 2017-02-26 14:08:46 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-02-26 14:08:46 +0300 |
commit | 575f13609fceeb7ddb599787bef0e83342de8391 (patch) | |
tree | ce9fed31792304ee12819267720caa8c0a6dc1a6 | |
parent | 6f0d0b811ad17f82acb2e798dba355d5b82af30d (diff) |
rewriting is no longer needed
-rw-r--r-- | backend.php | 3 | ||||
-rw-r--r-- | nginx.txt | 9 | ||||
-rw-r--r-- | read.html | 2 |
3 files changed, 3 insertions, 11 deletions
diff --git a/backend.php b/backend.php index f603fbf..c7d7ebc 100644 --- a/backend.php +++ b/backend.php @@ -184,7 +184,8 @@ break; default: - print json_encode(["error" => "UNKNOWN_METHOD"]); + header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); + echo "Method not found."; } diff --git a/nginx.txt b/nginx.txt deleted file mode 100644 index 6584012..0000000 --- a/nginx.txt +++ /dev/null @@ -1,9 +0,0 @@ - location /books { - auth_basic "bookz"; - auth_basic_user_file /etc/apache2/users.shared; - - rewrite /books/getbook/([0-9]+) /books/backend.php?op=download&id=$1 last; - - include php_params; - } - @@ -211,7 +211,7 @@ console.log("loading from network"); if (navigator.onLine) { - var book_url = "getbook/" + $.urlParam("id") + ".epub"; + var book_url = "backend.php?op=download&id=" + $.urlParam("id"); RSVP.on('error', function(error) { if ($(".loading").is(":visible")) { |