Browse Source

Truncate URLs above 1024 chars.

pull/24/head
Ben Kurtovic 9 years ago
parent
commit
331b05baae
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      copyvios/checker.py

+ 1
- 1
copyvios/checker.py View File

@@ -184,7 +184,7 @@ def _cache_result(page, result, conn, mode):
query2 = "INSERT INTO cache VALUES (?, DEFAULT, ?, ?)" query2 = "INSERT INTO cache VALUES (?, DEFAULT, ?, ?)"
query3 = "INSERT INTO cache_data VALUES (DEFAULT, ?, ?, ?, ?)" query3 = "INSERT INTO cache_data VALUES (DEFAULT, ?, ?, ?, ?)"
cache_id = buffer(sha256(mode + page.get().encode("utf8")).digest()) cache_id = buffer(sha256(mode + page.get().encode("utf8")).digest())
data = [(cache_id, source.url, source.confidence, source.skipped)
data = [(cache_id, source.url[:1024], source.confidence, source.skipped)
for source in result.sources] for source in result.sources]
with conn.cursor() as cursor: with conn.cursor() as cursor:
cursor.execute("START TRANSACTION") cursor.execute("START TRANSACTION")


Loading…
Cancel
Save