Index: database.sql ================================================================== --- database.sql +++ database.sql @@ -193,13 +193,10 @@ from_time time without time zone DEFAULT '00:00:00'::time without time zone NOT NULL, to_time time without time zone DEFAULT '23:59:59'::time without time zone NOT NULL, id_tag smallint NOT NULL ); -ALTER TABLE ONLY rules - ADD CONSTRAINT rules_pkey PRIMARY KEY (netmask); - ALTER TABLE ONLY rules ADD CONSTRAINT rules_tag_f FOREIGN KEY (id_tag) REFERENCES tag(id_tag) MATCH FULL ON UPDATE RESTRICT ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED; -- table to hold site arrays Index: squid-tagger.py ================================================================== --- squid-tagger.py +++ squid-tagger.py @@ -64,18 +64,18 @@ if row != None and row[0] != None: if row[1] != None: self._log.info('trying regexp "{}" versus "{}"\n'.format(row[1], url_path)) try: if re.compile(row[1]).match(url_path): - reply = '302:' + row[0] + reply = row[0].format(url_path) break else: continue except: self._log.info("can't compile regexp") else: - reply = '302:' + row[0] + reply = row[0].format(url_path) break self.writeline('{} {}\n'.format(id, reply)) def check(self, line): request = re.compile('^([0-9]+)\ (http|ftp):\/\/([-\w.:]+)\/([^ ]*)\ ([0-9.]+)\/(-|[\w\.]+)\ (-|\w+)\ (-|GET|HEAD|POST).*$').match(line)