Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/chrome/content/rules/newtalk.tw.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
http://.+\.newtalk\.tw/ redirect to ^ by server, and most of them are Invalid certificate.
-->

<ruleset name="newtalk.tw">

<!-- Complications: -->
<target host="*.newtalk.tw" />
<test url="http://abcdefg123456789.newtalk.tw/" />
<test url="http://ap1.newtalk.tw/" />
<test url="http://www.newtalk.tw/" />

<rule from="^http://\w+\.newtalk\.tw/" to="https://newtalk.tw/" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\w+ doesn't match with dash, such as abcdefg-123456789.newtalk.tw. I'd suggest you to use .+.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我就记得哪次中招过,.+ 通不过测试

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.+ 会要求两个额外的测试

Copy link
Copy Markdown
Contributor Author

@ivysrono ivysrono Dec 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://travis-ci.org/EFForg/https-everywhere/jobs/185161024#L193

failure: /opt/utils/../src/chrome/content/rules/newtalk.tw.xml failed test: The 'from' rule contains unescaped period in regular expression. Try escaping it with a backslash.

这个是多加两个测试就会通过?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

丧心病狂的电信……直接用手机开热点了

之前还没注意过/utils/trivial-validate.py#L74-L84,看了下觉得这个检测方式的误报率有点高……

留着\S吧,顺手 git blame Yimg.jp.xml (逃


<!-- Directly: -->
<target host="newtalk.tw" />

<target host="s.ntkstatic.org" />
<test url="http://s.ntkstatic.org/media/blog/293/blog_img_293.jpg" />

<rule from="^http:" to="https:" />
</ruleset>