Check iframe sandbox flags such as (allow-same-origin) in a case-insensitive way#1276
Conversation
There was a problem hiding this comment.
I know it is a bit hypocritical because of the usage of this.element, but I passed the sandbox as an argument to make this more of a pure function. No need for it to depend on some magiv instance var. Much easier to reason about then.
There was a problem hiding this comment.
This regex test is weird, and it won't allow insensitive matches. I think it'd be better to normalize this.sandbox_ into a string, then use !(/\s*allow-same-origin\s*/i).test(this.sandbox_).
There was a problem hiding this comment.
It is lower cased above, but that must be at least proven by a test and probably better to just redo locally here.
There was a problem hiding this comment.
Ah, I didn't see the #lowerCase. Still, the ' ' + this.sandbox_ + ' ' bothers me.
There was a problem hiding this comment.
Its stolen from jQuery's hyper optimized polyfill for hasClass :)
There was a problem hiding this comment.
|
Please add a test. |
e080b31 to
ff1dc5a
Compare
|
PTAL |
There was a problem hiding this comment.
But this also needs the toLowerCase treatment, no?
|
PTAL - all i had to do was add the /i to the regex - tests already exist - just tweaked one test. |
|
LGTM |
Check iframe sandbox flags such as (allow-same-origin) in a case-insensitive way
#1269