Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
emma
Commits
ca7508dc
Unverified
Commit
ca7508dc
authored
Apr 27, 2020
by
Philipp Winter
Browse files
Test GetTor's distribution URLs.
parent
9ff32932
Changes
2
Hide whitespace changes
Inline
Side-by-side
resources.go
View file @
ca7508dc
...
...
@@ -69,8 +69,12 @@ var domains = map[string]map[string]bool{
// Websites and a string that's meant to be in the website's body.
var
websites
=
map
[
string
]
string
{
"https://bridges.torproject.org"
:
"The Tor Project"
,
"https://torproject.org"
:
"Tor Browser"
,
"https://gettor.torproject.org"
:
"GetTor"
,
"https://ajax.aspnetcdn.com"
:
"Microsoft Ajax Content Delivery Network"
,
"https://bridges.torproject.org"
:
"The Tor Project"
,
"https://torproject.org"
:
"Tor Browser"
,
"https://gettor.torproject.org"
:
"GetTor"
,
"https://ajax.aspnetcdn.com"
:
"Microsoft Ajax Content Delivery Network"
,
"https://archive.org/details/@gettor"
:
"torbrowser-install"
,
"https://drive.google.com/drive/folders/13CADQTsCwrGsIID09YQbNz2DfRMUoxUU"
:
"tor-browser-linux"
,
"https://github.com/torproject/torbrowser-releases/"
:
"GetTor"
,
"https://gitlab.com/thetorproject/torbrowser-windows"
:
"torbrowser"
,
}
tests.go
View file @
ca7508dc
...
...
@@ -6,6 +6,7 @@ import (
"io/ioutil"
"net"
"net/http"
"net/url"
"strings"
"time"
)
...
...
@@ -66,14 +67,20 @@ func DoesDomainResolve(domain string, expected map[string]bool) error {
return
nil
}
func
DoesWebsiteContainStr
(
domain
,
substring
string
)
(
r
Result
)
{
func
DoesWebsiteContainStr
(
rawurl
,
substring
string
)
(
r
Result
)
{
defer
func
(
s
time
.
Time
)
{
r
.
ExecutionTime
=
time
.
Since
(
s
)
}(
time
.
Now
())
r
.
Target
=
domain
resp
,
err
:=
http
.
Get
(
domain
)
u
,
err
:=
url
.
Parse
(
rawurl
)
if
err
==
nil
{
r
.
Target
=
u
.
Host
}
else
{
r
.
Target
=
rawurl
}
resp
,
err
:=
http
.
Get
(
rawurl
)
if
err
!=
nil
{
r
.
Error
=
err
return
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment