I'm trying to create a properly formatted SVG element in TypeScript:
return document.createElementNS("http://www.w3.org/2000/svg", tag);
Forbidden http url in string: 'http://www.w3.org/2000/svg'
tslint is complaining due to the
no-http-string rule. The rule is defined as:
Do not use strings that start with 'http:'. URL strings should start with 'https:'. Http strings can be a security problem and indicator that your software may suffer from cookie-stealing attacks. Since version 1.0, this rule takes a list of regular expressions as a parameter. Any string matching that regular expression will be ignored. For example, to allow http connections to example.com and examples.com, configure your rule like this: "no-http-string": [true, "http://www.example.com/?.", "http://www.examples.com/?."]
Therefore, assuming you trust the World Wide Web Consortium, you could give it an exception in your
"no-http-string": [true, "http://www.w3.org/.*"]