Gnus development mailing list
 help / color / mirror / Atom feed
* W3 doesn't like bad URLs
@ 1998-12-03 17:03 Karl Kleinpaste
  1998-12-28 21:48 ` William M. Perry
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Kleinpaste @ 1998-12-03 17:03 UTC (permalink / raw)


It's no surprise that W3 doesn't approve, but a particular website
sometimes provides text/html containing bogus host-less URLs; some of
these pages get forwarded to an internal newsgroup here, and so I get
*Warning* buffers containing...

	(1) (url/warning) Malformed URL got passed into url-retrieve.
	Either `url-expand-file-name' is broken in some
	way, or an incorrect URL was manually entered (more likely).

...along with a minibuf message...

	Malformed URL: `http:/ABT_gif/Asia_Logo.gif'

...all of which is caused by...

<img src="http:/ABT_gif/Asia_Logo.gif" width=608 height=80 border=0 alt="Welcome to AsiaBizTech Web Site">

...and if I turn on `debug-on-error,' I get a stack trace:

Signaling: (error "Malformed URL: `http:/ABT_gif/Asia_Logo.gif'")
  signal(error ("Malformed URL: `http:/ABT_gif/Asia_Logo.gif'"))
  cerror("Malformed URL: `%s'" "http:/ABT_gif/Asia_Logo.gif")
  apply(cerror ("Malformed URL: `%s'" "http:/ABT_gif/Asia_Logo.gif"))
  error("Malformed URL: `%s'" "http:/ABT_gif/Asia_Logo.gif")
  url-http("http:/ABT_gif/Asia_Logo.gif")
  url-retrieve-internally("http:/ABT_gif/Asia_Logo.gif" nil)
  url-retrieve("http:/ABT_gif/Asia_Logo.gif")
  w3-maybe-start-image-download((image buffer #<buffer "*Article*"> :children ((item :to #<marker at 862 in *Article*> :from #<marker at 831 in *Article*> :button-extent #<extent (831, 862) H keymap help-echo balloon-help button-or-field button 0x899ee08 in buffer *Article*> :help-echo widget-image-summarize :parent #0 :notify widget-image-callback :action widget-default-action :delete widget-default-delete :tab-order -1 :button-face ... :tag "Welcome to AsiaBizTech Web Site" :format "%[%t%]" :value usemap :args nil)) where #<marker at 831 in *Article*> :src "http:/ABT_gif/Asia_Logo.gif" :button-face (#<face w3-style-face-00048 "An Emacs-W3 face... don't edit by hand."> #<face w3-style-face-00048 "An Emacs-W3 face... don't edit by hand."> #<face w3-style-face-00048 "An Emacs-W3 face... don't edit by hand."> #<face w3-style-face-00047 "An Emacs-W3 face... don't edit by hand."> #<face w3-style-face-00027 "An Emacs-W3 face... don't edit by hand."> #<face w3-style-face-00027 "An 
 E!
!
!
macs-W3 face... don't edit by hand.">) :target nil :href nil usemap nil ismap nil alt "Welcome to AsiaBizTech Web Site" :args nil))
  w3-resurrect-images()
  w3-draw-tree(((*document nil (...))))
  byte-code("[130 bytecode chars, deleted]" [get-buffer-create " *w3-region*" erase-buffer source w3-parse-buffer parse st nd w3-draw-tree nil widget glyph url w3-image-widgets-waiting widget-get :src assoc w3-graphics-list (widget-value-set widget glyph) ((error)) url-current-object 6 push-mark t w3-find-specific-link w3-running-xemacs device-type tty w3-fixup-eol-faces message "Drawing... done"] 3)
  w3-region(829 9720)
  byte-code("[11 bytecode chars]" [width w3-strict-width w3-region] 3)
  mm-inline-text((#<buffer " *mm*<4>"> ("text/html" (charset . "us-ascii") (name . "98120315.html")) 7bit nil ("inline" (filename . "98120315.html")) nil nil))
  mm-display-inline((#<buffer " *mm*<4>"> ("text/html" (charset . "us-ascii") (name . "98120315.html")) 7bit nil ("inline" (filename . "98120315.html")) nil nil))
  mm-display-part((#<buffer " *mm*<4>"> ("text/html" (charset . "us-ascii") (name . "98120315.html")) 7bit nil ("inline" (filename . "98120315.html")) nil nil) t)
  byte-code("[196 bytecode chars]" [ignored string-match type throw nil 4 handle "inline" not-attachment mm-automatic-display-p mm-inlinable-part-p mm-automatic-external-display-p t display split-string "/" "text" text gnus-article-mime-handle-alist id gnus-unbuttonized-mime-type-p gnus-article-insert-newline gnus-insert-mime-button move -2 gnus-newsgroup-default-charset gnus-newsgroup-iso-8859-1-forced mm-charset-iso-8859-1-forced rfc2047-default-charset mm-display-part mm-insert-inline mm-get-part] 5)
  gnus-mime-display-single((#<buffer " *mm*<4>"> ("text/html" (charset . "us-ascii") (name . "98120315.html")) 7bit nil ("inline" (filename . "98120315.html")) nil nil))
  gnus-mime-display-part((#<buffer " *mm*<4>"> ("text/html" (charset . "us-ascii") (name . "98120315.html")) 7bit nil ("inline" (filename . "98120315.html")) nil nil))
  mapcar(gnus-mime-display-part ((#<buffer " *mm*<3>"> ("text/plain" ...) 7bit (lambda nil ...) nil nil nil) (#<buffer " *mm*<4>"> ("text/html" ... ...) 7bit nil ("inline" ...) nil nil)))
  gnus-mime-display-mixed(((#<buffer " *mm*<3>"> ("text/plain" ...) 7bit (lambda nil ...) nil nil nil) (#<buffer " *mm*<4>"> ("text/html" ... ...) 7bit nil ("inline" ...) nil nil)))
  gnus-mime-display-part(("multipart/mixed" (#<buffer " *mm*<3>"> ("text/plain" ...) 7bit (lambda nil ...) nil nil nil) (#<buffer " *mm*<4>"> ("text/html" ... ...) 7bit nil ("inline" ...) nil nil)))
  gnus-display-mime()
  gnus-article-prepare-display()
  gnus-article-prepare(198 nil)
  gnus-summary-display-article(198 nil)
  gnus-summary-select-article(nil force)
  gnus-summary-show-article(nil)
  call-interactively(gnus-summary-show-article)

Admittedly, it's Wrong for this site to serve pages containing broken
URLs, but on the other hand, when this happens, the article doesn't
even render, because the interaction with bringing up the *Warning*
removes the rest of my buffers from visibility.  Would it be possible
for W3 to be a bit more forgiving, and render the rest of the page
anyhow?

Feedback to the site in question is of course also being done, since
this shouldn't be a problem in the first place.

Just wondering...there isn't some pseudostandard involved here, where
a host-less URL implicitly refers to the host from which the
containing page emanated, such that W3 is responsible for figuring
this out on its own?


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

* Re: W3 doesn't like bad URLs
  1998-12-03 17:03 W3 doesn't like bad URLs Karl Kleinpaste
@ 1998-12-28 21:48 ` William M. Perry
  0 siblings, 0 replies; 2+ messages in thread
From: William M. Perry @ 1998-12-28 21:48 UTC (permalink / raw)
  Cc: ding

Karl Kleinpaste <karl@justresearch.com> writes:

> It's no surprise that W3 doesn't approve, but a particular website
> sometimes provides text/html containing bogus host-less URLs; some of
> these pages get forwarded to an internal newsgroup here, and so I get
> *Warning* buffers containing...
> 
> 	(1) (url/warning) Malformed URL got passed into url-retrieve.
> 	Either `url-expand-file-name' is broken in some
> 	way, or an incorrect URL was manually entered (more likely).
> 
> ...along with a minibuf message...
> 
> 	Malformed URL: `http:/ABT_gif/Asia_Logo.gif'
> 
> ...all of which is caused by...
> 
> <img src="http:/ABT_gif/Asia_Logo.gif" width=608 height=80 border=0 alt="Welcome to AsiaBizTech Web Site">
> 
> ...and if I turn on `debug-on-error,' I get a stack trace:

[...]

> Admittedly, it's Wrong for this site to serve pages containing broken
> URLs, but on the other hand, when this happens, the article doesn't even
> render, because the interaction with bringing up the *Warning* removes
> the rest of my buffers from visibility.  Would it be possible for W3 to
> be a bit more forgiving, and render the rest of the page anyhow?
> 
> Just wondering...there isn't some pseudostandard involved here, where a
> host-less URL implicitly refers to the host from which the containing
> page emanated, such that W3 is responsible for figuring this out on its
> own?

  Nope - if something specifies the scheme portion of the url (http), then
that is _it_, and no relative expansion is to be done.  So sayeth the
URI/URL/URN expansion RFCs.

  Does this patch help at all?

-bp

Index: url-http.el
===================================================================
RCS file: /gd/gnu/cvsroot/w3/lisp/url-http.el,v
retrieving revision 1.1.1.2
diff -c -w -c -w -r1.1.1.2 url-http.el
*** url-http.el	1998/12/18 02:19:36	1.1.1.2
--- url-http.el	1998/12/28 21:46:39
***************
*** 549,564 ****
        (if (equal port "") (setq port "80"))
        (if (equal file "") (setq file "/"))
        (if (not server)
! 	  (progn
! 	    (url-warn
! 	     'url
! 	     (eval-when-compile
! 	       (concat
! 		"Malformed URL got passed into url-retrieve.\n"
! 		"Either `url-expand-file-name' is broken in some\n"
! 		"way, or an incorrect URL was manually entered (more likely)."
! 		)))
! 	    (error "Malformed URL: `%s'" url)))
        (if (or (not (member port url-bad-port-list))
  	      (funcall url-confirmation-func
  		       (concat
--- 549,555 ----
        (if (equal port "") (setq port "80"))
        (if (equal file "") (setq file "/"))
        (if (not server)
! 	  (message "Malformed URL: `%s'" url)
  	(if (or (not (member port url-bad-port-list))
  		(funcall url-confirmation-func
  			 (concat
***************
*** 600,606 ****
  				 'url-after-change-function))))))
  	(progn
  	  (ding)
! 	  (url-warn 'security "Aborting connection to bad port..."))))))
  
  (defun url-https (url)
    ;; Retrieve a URL via SSL
--- 591,597 ----
  				   'url-after-change-function))))))
  	  (progn
  	    (ding)
! 	    (url-warn 'security "Aborting connection to bad port...")))))))
  
  (defun url-https (url)
    ;; Retrieve a URL via SSL


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

end of thread, other threads:[~1998-12-28 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-03 17:03 W3 doesn't like bad URLs Karl Kleinpaste
1998-12-28 21:48 ` William M. Perry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).