Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-852

Need better error message for invalid Mediacast URL

    XMLWordPrintableJSON

Details

    Description

      The error messages around invalid media urls need improvement.

      Greg Hamer posted a draft bug report on getting Invaild Media URL messages on what appeared to be valid URLS to the users list, to which Dave replied:

      Greg,

      When you enter a Podcast URL in a blog entry, Roller uses HTTP HEAD (via the Java class HttpURLConnection) to query the URL to obtain the content-type and content-length.

      I tried each of the URLs you specified (which BTW are all web pages, not "media" files) and stopped Roller in the debugger. All of those URLs are returning a -1 content type, so Roller treats them as invalid (I believe the enclosure tag needs both content-type and content-length). I'm not sure why they return -1, I guess that means the websites are not returning content-lengths at all.

      So, I don't think this is a Roller MediaCast bug, but perhaps we could add better error messages.

      • Dave

      Anil said:

      This is somewhat of a weakness in RSS; enclosures are supposed to have specified (not indeterminate content lengths).

      The code is checking that the content-type and content-length can be fetched using HEAD. This requires more documentation and the error message and/or User Guide needs to be clearer about why it's considered invalid.

      Fetching the entire content in this case seems inappropriate. An alternate strategy is to leave this indeterminate until the RSS feed is read, and then prefetch the entire content before forming the enclosure tag. This requires unbounded buffers, and so isn't palatable.

      On a side note, I notice that the HTTP connection used to perform the HEAD operation is leaked.

      Will fix the messages and docs, but am downgrading to Minor. Complain if this seems inappropriate, or if you have alternate suggestions on implementation.

      Attachments

        Activity

          People

            agangolli Anil Gangolli
            agangolli Anil Gangolli
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: