article generator throws 405 on non-post
This commit is contained in:
parent
c785235e81
commit
8a717ca0e9
1 changed files with 9 additions and 0 deletions
|
@ -149,6 +149,15 @@ function load_blog($conn, $blogId){
|
|||
$datePosted, $dateEdited, $tags, $comments);
|
||||
}
|
||||
|
||||
// If request is not POST, throw method not allowed
|
||||
if(strcmp($_SERVER["REQUEST_METHOD"], "POST") != 0)
|
||||
{
|
||||
header($_SERVER["SERVER_PROTOCOL"]." 405 Method Not Allowed", true, 405);
|
||||
include_once($_SERVER["DOCUMENT_ROOT"]."/errors/405.php");
|
||||
include_once($COMMONS."/footer.php");
|
||||
die();
|
||||
}
|
||||
|
||||
// Check DB connection
|
||||
if($conn == null){
|
||||
header($_SERVER["SERVER_PROTOCOL"]." 503 Service Unavailable", true, 503);
|
||||
|
|
Loading…
Reference in a new issue