File tree 3 files changed +5
-5
lines changed
lib/qiita/markdown/transformers 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ def node
42
42
43
43
def host_of ( url )
44
44
if url
45
- port = URI . parse ( url ) . port
46
- Addressable ::URI . parse ( url ) . host if [ 443 , 80 ] . include? port
45
+ scheme = URI . parse ( url ) . scheme
46
+ Addressable ::URI . parse ( url ) . host if [ "http" , "https" ] . include? scheme
47
47
end
48
48
rescue Addressable ::URI ::InvalidURIError
49
49
nil
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ def node
44
44
45
45
def host_of ( url )
46
46
if url
47
- port = URI . parse ( url ) . port
48
- Addressable ::URI . parse ( url ) . host if [ 443 , 80 ] . include? port
47
+ scheme = URI . parse ( url ) . scheme
48
+ Addressable ::URI . parse ( url ) . host if [ "http" , "https" ] . include? scheme
49
49
end
50
50
rescue Addressable ::URI ::InvalidURIError
51
51
nil
Original file line number Diff line number Diff line change 1616
1616
context "with embed iframe code with xss" do
1617
1617
let ( :markdown ) do
1618
1618
<<-MARKDOWN . strip_heredoc
1619
- <iframe src="javascript://docs.google.com/presentation/d/example/embed " frameborder="0" width="482" height="300" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
1619
+ <iframe src="javascript://docs.google.com:80/%0d%0aalert(document.domain) " frameborder="0" width="482" height="300" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
1620
1620
MARKDOWN
1621
1621
1622
1622
it "forces width attribute on iframe" do
You can’t perform that action at this time.
0 commit comments