Re: [whatwg/url] Record whether the URL parser removed newlines. (#284)

A more efficient implementation can and has been done in https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/URLParser.cpp
In the common case it will look at each code point in the input string once (except a bit of extra processing in the host), increment the unmodified ref-counted string, and store some offsets in an efficient data structure.  Newline and tab checking is not done in a separate and simple loop, but rather every time the iterator on the input is incremented.  All this is just an implementation detail and people can implement the spec however they see fit, but I oppose to adding necessary data fields and additional operations everywhere in efficient implementations of an algorithm, especially if the benefit is just to guess whether fetched data is malicious.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/284#issuecomment-303332632

Received on Tuesday, 23 May 2017 08:47:19 UTC