Merge branch 'open-access-to-metadata' into test-branch

This commit is contained in:
Benjamin Dauvergne 2012-02-07 14:09:49 +01:00
commit b7b05acc55
1 changed files with 10 additions and 0 deletions

View File

@ -3017,6 +3017,16 @@ int am_check_uid(request_rec *r)
{
am_cache_entry_t *session;
int return_code = HTTP_UNAUTHORIZED;
am_dir_cfg_rec *dir = am_get_dir_cfg(r);
/* Always allow access to [endpoint_path]/metadata
*/
if (strstr(r->uri, dir->endpoint_path) == r->uri) {
char *endpoint = &r->uri[strlen(dir->endpoint_path)];
if (strcmp(endpoint, "metadata") == 0) {
return OK;
}
}
/* check if we are a subrequest. if we are, then just return OK
* without any checking since these cannot be injected (heh). */