Apache HTTPD
Classes | Typedefs | Functions | Variables
mod_allowmethods.c File Reference
#include "httpd.h"
#include "http_core.h"
#include "http_config.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_log.h"
#include "apr_strings.h"

Go to the source code of this file.

Classes

struct  am_conf_t
 

Typedefs

typedef struct am_conf_t am_conf_t
 

Functions

static int am_check_access (request_rec *r)
 
static void * am_create_conf (apr_pool_t *p, char *dummy)
 
static void * am_merge_conf (apr_pool_t *pool, void *a, void *b)
 
static const charam_allowmethods (cmd_parms *cmd, void *d, int argc, char *const argv[])
 
static void am_register_hooks (apr_pool_t *p)
 

Variables

static const command_rec am_cmds []
 
static int *const aplog_module_index = &( allowmethods_module.module_index)
 

Typedef Documentation

◆ am_conf_t

This module makes it easy to restrict what HTTP methods can be ran against a server.

It provides one command: AllowMethods This command takes a list of HTTP methods to allow.

The most common configuration should be like this: <Directory > AllowMethods GET HEAD OPTIONS </Directory> <Directory /special/cgi-bin> AllowMethods GET HEAD OPTIONS POST </Directory> Non-matching methods will be returned a status 405 (method not allowed)

To allow all methods, and effectively turn off mod_allowmethods, use: AllowMethods reset

Function Documentation

◆ am_allowmethods()

static const char * am_allowmethods ( cmd_parms cmd,
void *  d,
int  argc,
char *const  argv[] 
)
static

no valid method

Definition at line 106 of file mod_allowmethods.c.

◆ am_check_access()

static int am_check_access ( request_rec r)
static

< Module declines to handle

< Module declines to handle

Definition at line 53 of file mod_allowmethods.c.

◆ am_create_conf()

static void * am_create_conf ( apr_pool_t p,
char dummy 
)
static

Definition at line 79 of file mod_allowmethods.c.

◆ am_merge_conf()

static void * am_merge_conf ( apr_pool_t pool,
void *  a,
void *  b 
)
static

Definition at line 88 of file mod_allowmethods.c.

◆ am_register_hooks()

static void am_register_hooks ( apr_pool_t p)
static

Definition at line 138 of file mod_allowmethods.c.

Variable Documentation

◆ am_cmds

const command_rec am_cmds[]
static
Initial value:
= {
{ "AllowMethods" , am_allowmethods , NULL , 64 , TAKE_ARGV, "only allow specific methods" },
{NULL}
}
@ TAKE_ARGV
Definition http_config.h:66
static const char * am_allowmethods(cmd_parms *cmd, void *d, int argc, char *const argv[])
return NULL
Definition mod_so.c:359

Definition at line 143 of file mod_allowmethods.c.

◆ aplog_module_index

int* const aplog_module_index = &( allowmethods_module.module_index)
static

Definition at line 150 of file mod_allowmethods.c.