Skip to content

Commit

Permalink
fix for websockets and authorization headers not supported on iphone
Browse files Browse the repository at this point in the history
* temporarily remove auth just for websockets - okay because its read-only
* permanent solution is to move to cookie auth
  • Loading branch information
jpillora committed Sep 20, 2015
1 parent 574f97a commit bf5b2f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $ cloud-torrent --help
--version, -v
Version:
0.8.3
0.8.4
Read more:
https://github.com/jpillora/cloud-torrent
Expand Down
19 changes: 10 additions & 9 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ func (s *Server) reconfigure(c engine.Config) error {
}

func (s *Server) handle(w http.ResponseWriter, r *http.Request) {

//handle realtime client connections
if r.URL.Path == "/realtime.js" {
realtime.JS.ServeHTTP(w, r)
return
} else if r.URL.Path == "/realtime" {
s.rt.ServeHTTP(w, r)
return
}

//basic auth
if s.Auth != "" {
u, p, _ := r.BasicAuth()
Expand All @@ -193,15 +203,6 @@ func (s *Server) handle(w http.ResponseWriter, r *http.Request) {
return
}
}

//handle realtime client connections
if r.URL.Path == "/realtime.js" {
realtime.JS.ServeHTTP(w, r)
return
} else if r.URL.Path == "/realtime" {
s.rt.ServeHTTP(w, r)
return
}
//search
if strings.HasPrefix(r.URL.Path, "/search") {
s.scraperh.ServeHTTP(w, r)
Expand Down

0 comments on commit bf5b2f7

Please sign in to comment.