From 46fa1790c6d5e990030d8b2b7ae07cb150a49730 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Tue, 09 Jan 2007 20:04:29 +0000 Subject: canonicalization bug - do not add '/' after '?', add it right after hostname if needed. --- diff --git a/lib/consumer.cc b/lib/consumer.cc index cbe0769..bb6358c 100644 --- a/lib/consumer.cc +++ b/lib/consumer.cc @@ -333,8 +333,15 @@ namespace opkele { }else{ i += sizeof("://")-1; } - if(rv.find('/',i)==string::npos) - rv += '/'; + string::size_type qm = rv.find('?',i); + string::size_type sl = rv.find('/',i); + if(qm!=string::npos) { + if(sl==string::npos || sl>qm) + rv.insert(qm,1,'/'); + }else{ + if(sl==string::npos) + rv += '/'; + } return rv; } -- cgit v0.9.0.2