summaryrefslogtreecommitdiff
path: root/src/capi.c
diff options
context:
space:
mode:
authorp37sitdu, corvid <devnull@localhost>2012-10-03 01:19:45 +0000
committerp37sitdu, corvid <devnull@localhost>2012-10-03 01:19:45 +0000
commit39ee4950acf53e63f0a8bf8cd7111f7ad282f6bb (patch)
treedc8779a49e158a5d0e9e4327543f672a41b1ec23 /src/capi.c
parent78003c727f7eae3a593260941aa4db6627dd1e75 (diff)
introduce domainrc mechanism
Diffstat (limited to 'src/capi.c')
-rw-r--r--src/capi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/capi.c b/src/capi.c
index db8e6b87..1da2d9ca 100644
--- a/src/capi.c
+++ b/src/capi.c
@@ -26,6 +26,7 @@
#include "nav.h"
#include "dpiapi.h"
#include "uicmd.hh"
+#include "domain.h"
#include "../dpip/dpip.h"
/* for testing dpi chat */
@@ -378,6 +379,13 @@ int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
const char *scheme = URL_SCHEME(web->url);
int safe = 0, ret = 0, use_cache = 0;
+ /* web->requester is NULL if the action is initiated by user */
+ if (!(a_Capi_get_flags(web->url) & CAPI_IsCached ||
+ web->requester == NULL ||
+ a_Domain_permit(web->requester, web->url))) {
+ return 0;
+ }
+
/* reload test */
reload = (!(a_Capi_get_flags(web->url) & CAPI_IsCached) ||
(URL_FLAGS(web->url) & URL_E2EQuery));