RESOLVED INVALID 80265
The path of URL has redundant slashes should not be cached again in offline web applications
https://bugs.webkit.org/show_bug.cgi?id=80265
Summary The path of URL has redundant slashes should not be cached again in offline w...
huangxueqing
Reported 2012-03-05 04:26:02 PST
Created attachment 130093 [details] test case INTRODUCTION: It's commom that user input more than one slashes in path of url due to careless, such as "http://127.0.0.1:8000//appcache//test.html" actually specify "http://127.0.0.1:8000/appcache/test.html". REPOS STEPS: 1. Unzip attachment and move "appcache" folder into %APACHE_ROOT%; 2. Navigate http://127.0.0.1/appcache/test.html; 2. Naviagte http://127.0.0.1/////appcache/////test.html; ACTUAL RESULTS: There ware two record in cacheGroup table identified by "http://127.0.0.1/appcache/test.manifest" and "http://127.0.0.1/////appcache/////test.manifest" respectively. EXPECTED RESULTS: Only one record in cacheGroup identified by "http://127.0.0.1/appcache/test.manifest". REPOS STEPS: 1. Navigate http://127.0.0.1/appcache/test.html; 2. Shutdown apache; 3. Navigate http://127.0.0.1/////appcache/test.html; ACTUAL RESULTS: Failed to load test.html from local cache. EXPECTED RESULTS: Load test.html from local cache correctly.
Attachments
test case (274 bytes, application/octet-stream)
2012-03-05 04:26 PST, huangxueqing
no flags
test case (274 bytes, text/html)
2012-03-05 04:42 PST, huangxueqing
no flags
patch (17.36 KB, patch)
2012-03-05 05:22 PST, huangxueqing
webkit.review.bot: commit-queue-
skip layout test cases in chromium platform (18.24 KB, patch)
2012-03-05 06:25 PST, huangxueqing
buildbot: commit-queue-
patch (18.47 KB, patch)
2012-03-05 07:00 PST, huangxueqing
buildbot: commit-queue-
patch (18.46 KB, patch)
2012-03-05 07:45 PST, huangxueqing
no flags
patch (18.49 KB, patch)
2012-03-05 07:51 PST, huangxueqing
abarth: review-
WebKit Review Bot
Comment 1 2012-03-05 04:29:45 PST
Attachment 130093 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files']" exit_code: 1 Total errors found: 0 in 0 files If any of these errors are false positives, please file a bug against check-webkit-style.
huangxueqing
Comment 2 2012-03-05 04:42:17 PST
Created attachment 130094 [details] test case
huangxueqing
Comment 3 2012-03-05 05:22:16 PST
WebKit Review Bot
Comment 4 2012-03-05 05:54:21 PST
Comment on attachment 130099 [details] patch Attachment 130099 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11803984 New failing tests: http/tests/appcache/fallback-multiply-slashes.html http/tests/appcache/appcache-multiply-slashes.html
huangxueqing
Comment 5 2012-03-05 06:25:09 PST
Created attachment 130112 [details] skip layout test cases in chromium platform
Build Bot
Comment 6 2012-03-05 06:34:29 PST
Comment on attachment 130112 [details] skip layout test cases in chromium platform Attachment 130112 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/11808564
Build Bot
Comment 7 2012-03-05 06:42:42 PST
huangxueqing
Comment 8 2012-03-05 07:00:59 PST
Build Bot
Comment 9 2012-03-05 07:33:18 PST
huangxueqing
Comment 10 2012-03-05 07:45:59 PST
huangxueqing
Comment 11 2012-03-05 07:51:55 PST
Adam Barth
Comment 12 2012-03-05 10:08:00 PST
Comment on attachment 130134 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=130134&action=review > Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp:59 > +String stripRedundantSlashes(const String& str) I'm sorry that I will not be able to review your patch fully, but this function clearly does not belong in this file.
Alexey Proskuryakov
Comment 13 2012-03-05 11:11:52 PST
I don't think that there is a concept of normalizing a URL by removing duplicate slashes, is there? Thus, this looks like correct behavior to me.
Adam Barth
Comment 14 2012-03-05 11:14:48 PST
> I don't think that there is a concept of normalizing a URL by removing duplicate slashes, is there? Correct. I'm not away of any precedent for normalizing URIs by removing redundant slashes from the path. There is some precedent for removing redundant slashes between the scheme and the authority, but even that is controversial (e.g., in the IETF's IRI working group).
Alexey Proskuryakov
Comment 15 2012-03-05 11:28:58 PST
Please feel free to reopen if there is evidence that this is a bug.
huangxueqing
Comment 16 2012-03-05 17:43:57 PST
Thanks for review. It's not well to put this function into KURL.h since KURL never call it. Any suggestions? (In reply to comment #12) > (From update of attachment 130134 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=130134&action=review > > > Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp:59 > > +String stripRedundantSlashes(const String& str) > > I'm sorry that I will not be able to review your patch fully, but this function clearly does not belong in this file.
huangxueqing
Comment 17 2012-03-05 17:54:29 PST
No, but in my view, "appcache" as a "nightly web server" in local since it provide resource just like a web server, and web server always handle redundant slashes in path correctly such as apache, thus "appcache" should do that also. In addition, it's unnecessary that store a manifest twice. (In reply to comment #13) > I don't think that there is a concept of normalizing a URL by removing duplicate slashes, is there? > > Thus, this looks like correct behavior to me.
Alexey Proskuryakov
Comment 18 2012-03-05 19:56:23 PST
> No, but in my view, "appcache" as a "nightly web server" It's perfectly appropriate for a Web server to provide different responses to requests with different number of slashes.
huangxueqing
Comment 19 2012-03-05 23:21:07 PST
(In reply to comment #18) > > No, but in my view, "appcache" as a "nightly web server" > > It's perfectly appropriate for a Web server to provide different responses to requests with different number of slashes. All right, thanks for review. Maybe I will investigate how web server handle it.
Note You need to log in before you can comment on or make changes to this bug.