all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] url-cache-create-filename: parse and recreate URL
@ 2010-09-22 16:26 Julien Danjou
  2010-09-25 21:00 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Danjou @ 2010-09-22 16:26 UTC (permalink / raw)
  To: emacs-devel; +Cc: Julien Danjou

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/url/ChangeLog    |    6 ++++++
 lisp/url/url-cache.el |   14 +++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 9bc9d31..0a35fd9 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-22  Julien Danjou  <julien@danjou.info>
+
+	* url-cache.el (url-cache-create-filename): Parse and recreate URL
+	to make sure we remove the port if the default one is specified in
+	the URL.
+
 2010-09-19  Julien Danjou  <julien@danjou.info>
 
 	* url-cache.el (url-fetch-from-cache): New function.
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 28d0af7..67065e5 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -87,8 +87,7 @@ FILE can be created or overwritten."
 (defun url-cache-create-filename-human-readable (url)
   "Return a filename in the local cache for URL."
   (if url
-      (let* ((url (if (vectorp url) (url-recreate-url url) url))
-	     (urlobj (url-generic-parse-url url))
+      (let* ((urlobj (url-generic-parse-url url))
 	     (protocol (url-type urlobj))
 	     (hostname (url-host urlobj))
 	     (host-components
@@ -146,8 +145,7 @@ FILE can be created or overwritten."
 Very fast if you have an `md5' primitive function, suitably fast otherwise."
   (require 'md5)
   (if url
-      (let* ((url (if (vectorp url) (url-recreate-url url) url))
-	     (checksum (md5 url))
+      (let* ((checksum (md5 url))
 	     (urlobj (url-generic-parse-url url))
 	     (protocol (url-type urlobj))
 	     (hostname (url-host urlobj))
@@ -177,7 +175,13 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise."
   :group 'url-cache)
 
 (defun url-cache-create-filename (url)
-  (funcall url-cache-creation-function url))
+  (funcall url-cache-creation-function
+           ;; We need to parse+recreate in order to remove the default port
+           ;; if it has been specified: e.g. http://www.example.com:80 will
+           ;; be transcoded as http://www.example.com
+           (url-recreate-url
+            (if (vectorp url) url
+              (url-generic-parse-url url)))))
 
 ;;;###autoload
 (defun url-cache-extract (fnam)
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-25 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-22 16:26 [PATCH] url-cache-create-filename: parse and recreate URL Julien Danjou
2010-09-25 21:00 ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.