From 480bc446f89e9dc4a2c243ca98b9fcfd551a9b3a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 14 Nov 2010 14:02:09 -0500 Subject: [PATCH] * In TVRenamer.buildURL_(), encode the show name in case it has spaces * nil is also a valid error from the proxy response --- src/server.go | 2 +- web_frontend/tv_renamer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server.go b/src/server.go index 8c2df4b..07674a0 100644 --- a/src/server.go +++ b/src/server.go @@ -120,7 +120,7 @@ func performProxy(url *http.URL, response http.ResponseWriter, origRequest *http } var proxyResponse *http.Response proxyResponse, err = client.Read() - if err != http.ErrPersistEOF { + if err != nil && err != http.ErrPersistEOF { return err } _, err = io.Copy(response, proxyResponse.Body) diff --git a/web_frontend/tv_renamer.js b/web_frontend/tv_renamer.js index 5134b62..823d8bb 100644 --- a/web_frontend/tv_renamer.js +++ b/web_frontend/tv_renamer.js @@ -99,8 +99,8 @@ armadillo.TVRenamer.prototype.parseName_ = function(name) { * @private */ armadillo.TVRenamer.prototype.buildURL_ = function(show, season, episode) { - return "http://services.tvrage.com/tools/quickinfo.php?show=" + show + - "&ep=" + season + "x" + episode; + return "http://services.tvrage.com/tools/quickinfo.php?show=" + + encodeURIComponent(show) + "&ep=" + season + "x" + episode; }; /** -- 2.43.5