Skip to content

Commit

Permalink
Stop using data scheme for navigating user
Browse files Browse the repository at this point in the history
  • Loading branch information
hakobe committed Jul 11, 2017
1 parent 114f363 commit 2eba0f3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"html/template"
"log"
"net/http"
"net/url"
"os"
"regexp"
"strconv"
Expand Down Expand Up @@ -83,19 +82,24 @@ func Start(db *sql.DB) chan *slackOutgoing.Op {
}
accesslogs.Access(db, id)
tmpl, err := template.New("entry").Parse(`
<!DOCTYPE html>
<html>
<body></body>
<head>
<meta http-equiv="refresh" content="0;URL=data:text/html,%3Cmeta%20http-equiv%3D%22refresh%22%20content%3D%220%3BURL%3D{{.}}%22%3E"></meta>
<title>Redirector</title>
<meta name="referrer" content="never">
<meta name="referrer" content="no-referrer">
<meta http-equiv="Refresh" content="0; URL={{.}}">
</head>
<body>
</body>
</html>
`)
if err != nil {
http.Error(rw, err.Error(), http.StatusInternalServerError)
return
}

tmpl.Execute(rw, template.HTML(url.QueryEscape(entry.Url())))
tmpl.Execute(rw, template.HTML(entry.Url()))
},
)

Expand Down

0 comments on commit 2eba0f3

Please sign in to comment.