fixed _nonHtml to work on pathname only (without query string), added test