infocalypse
 

mimetype problems

Title: mime-type problems
ID: 5916e6e8328e20d8b0276b76b7116dd432730778
*Resolved* Owned By: Arne Babenhauserheide 
Filed On: Wednesday, November 21 2012 03:11AM

[details]

 toad_: I get Does not look like a MIME type: "application/mercurial-bundle;0"
 when trying to pull with infocalypse
 freenet.client.MetadataParseException: Does not look like a MIME type: "application/mercurial-bundle;0"
 ArneBab: because of the ;0 ?
 that may actually be the error
 yes… 
 but I think ;x is an allowed symbol in headers.
 also in mime types?
 there is a special rfc which defines the syntax of mime types. i didn't read it yet
 the rfc for HTTP 1.0 and HTTP 1.1 say that mime types must be based on that MIME type RFC
 that's at least how i remember it
 ^ well, prepare for a run from spanish (it is spanish, right?) speaking people :)
 its a nice and short tutorial for newcomers
 wait, just 33 warnings on current fred-staging? :)
 and most of them are generic related or "not used" warnings
 ech… FCP2.0 doesn't have support for user defined metadata, so we
         jam the metadata we need into the mime type field.
 for my infocalypse repo for flircp fproxy shows this:
     Filename: flircp.R1-5.bin
     Size: unknown
     Expected type: application/octet-stream
 why don't you use application/octet-stream too?
      content := "Content-Type" ":" type "/" subtype
                 *(";" parameter)
 the ; is the allowed separator for parameters
 so freenet is being too zealous here
 http://www.ietf.org/rfc/rfc2045.txt
 as far as I can tell, infocalypse uses the mime-type to supply additional information… 
 SeekingFor: Did the content-type handling in freenet change in the last few months?
 toad_: maybe I should ask you that: : Did the content-type handling in freenet change in the last few months?
 from freenet.client.DefaultMIMETypes.java:789
 private static final String TOP_LEVEL = "(?>[a-zA-Z-]+)";
         private static final String CHARS = "(?>[a-zA-Z0-9+_\\-\\.]+)";
 private static final String PARAM = "(?>;\\s*"+CHARS+"="+"(("+CHARS+")|(\".*\")))";
         private static Pattern MIME_TYPE = Pattern.compile(TOP_LEVEL+"/"+CHARS+"\\s*"+PARAM+"*");
         public static boolean isPlausibleMIMEType(String mimeType) {
                 return MIME_TYPE.matcher(mimeType).matches();
         }
 this looks like it should be ok to use *(";" paramater)
 so the error must be triggered somewhere else
 yes… 
 does it have a list of allowed mime types?
 yes, same file
         /* From toad's /etc/mime.types
          * cat /etc/mime.types | sed "/^$/d;/#/d" | tr --squeeze '\t' ' ' |
          * (y=0; while read x; do echo "$x" |
          * sed -n "s/^\([^ ]*\)$/addMIMEType\($y, \"\1\"\);/p;s/^\([^ (),]\+\) \(.*\)$/addMIMEType\($y, \"\1\", \"\2\"\);/p;"; y=$((y+1)); done)
          */
 but that list does not contain any application/mercurial type

- all bugs -