Squid url redirector

Check-in [a326d03ba1]
anonymous

Check-in [a326d03ba1]

Overview
Comment:support for substituting domain and path when redirecting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: a326d03ba1062517d2b4ad2c66d7c8447a421e2ccdb8d334609aa9d850f2028e
User & Date: arcade@b1t.name on 2013-03-13 17:22:53.000
Other Links: branch diff | manifest | tags
Context
2013-08-07
13:29
* Support for CONNECT queries. Matches only if no regexp specified for site as we can't see url. * Remove syslog recode tweak. check-in: 25bd939a42 user: arcade@b1t.name tags: master, trunk
2013-03-13
17:22
support for substituting domain and path when redirecting check-in: a326d03ba1 user: arcade@b1t.name tags: master, trunk
2013-01-24
13:38
fixing bug with too big error message flowing to syslog check-in: 46225bbe65 user: arcade@b1t.name tags: master, trunk
Changes
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
		#self._log.info('got {} lines from database'.format(len(result)))
		for row in result:
			if row != None and row[0] != None:
				if row[1] != None:
					self._log.info('trying regexp "{}" versus "{}"'.format(row[1], url_path))
					try:
						if re.compile(row[1]).match(url_path):
							reply = row[0].format(url_path)
						else:
							continue
					except:
						self._log.info("can't compile regexp")
				else:
					reply = row[0].format(url_path)
			if reply != None:
				self.writeline('{} {}'.format(id, reply))
				return(True)
		self.writeline('{}'.format(id))

	def loop(self):
		while True:







|





|







317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
		#self._log.info('got {} lines from database'.format(len(result)))
		for row in result:
			if row != None and row[0] != None:
				if row[1] != None:
					self._log.info('trying regexp "{}" versus "{}"'.format(row[1], url_path))
					try:
						if re.compile(row[1]).match(url_path):
							reply = row[0].format(host = site, path = url_path)
						else:
							continue
					except:
						self._log.info("can't compile regexp")
				else:
					reply = row[0].format(host = site, path = url_path)
			if reply != None:
				self.writeline('{} {}'.format(id, reply))
				return(True)
		self.writeline('{}'.format(id))

	def loop(self):
		while True: