GroupStudy.com GroupStudy.com - A virtual community of network engineers
 Home  BookStore  StudyNotes  Links  Archives  StudyRooms  HelpWanted  Discounts  Login
RE: matching pictures w/ mime posted 10/02/2004
[Chronological Index] [Thread Index] [Top] [Date Prev][Date Next] [Thread Prev][Thread Next]


Hi Carlos-
	    I was of the same understanding as you until, I completely
(mostly) read the RFCs giving specification for mime-types and subtypes.
".jpg" is a valid subtype.

Per RFC2045, RFC2046 MIME image subtypes can be image/*jpg. The primary
types are: application, audio, image, message, model, multipart, text and
video. Each of these categories has either: Content Types, Content Subtypes,
Character Sets, Access Types, and conversion values.

I miss typed when I previously wrote ".jpg". Although that is a valid MIME
image subtype, it was not what I was looking for. 

http://www.iana.org/assignments/media-types/image/

> As I pointed out before, there is no mime content type that ends with 
> jpg. The content type is "image/jpeg" in the case of JPEG encoded images.

I think there is, although not specifically relevant to what we're talking
about, "image/vnd.sealedmedia.softseal.jpg"<-- is a subtype of MIME image
and would match the string "*jpg".  In any event, using the subtype "jpg"
would not drop jpegs. 

http://www.iana.org/assignments/media-types/image/

So, yes a minor, but fatal phopa.  Lesson learned, don't for get the "e" in
jpeg when filtering MIME type images-

class-map match-any IMAGES
   match protocol http url "*.gif"
   match protocol http url "*.jpg"
   match protocol http mime "*gif"
   match protocol http mime "*jpeg"
!
!
  policy-map QOS
  class IMAGES
    drop

Thanks
Alsontra 


-----Original Message-----
From: nobody@xxxxxxxxxxxxxx [mailto:nobody@xxxxxxxxxxxxxx] On Behalf Of
Carlos G Mendioroz
Sent: Saturday, October 02, 2004 5:07 AM
To: none
Cc: 'John Matus'; 'lab'
Subject: Re: matching pictures w/ mime

Given that you could not got it to work, I would get suspicious about it 
being right :-)

As I pointed out before, there is no mime content type that ends with 
jpg. The content type is "image/jpeg" in the case of JPEG encoded images.

Pay attention to the direction of traffic that you apply the filter to.
GETs (from browser to server) are the ones carrying the URL, so the ones 
that you can you can filter with URL.
Responses are the ones carrying content and content type header, where 
the MIME filter works.

Some labs just don't pay attention to this and ask you to filter such 
and such, leaving to your imagination where clients (browsers) and 
servers are...

-Carlos

none wrote:

> Hi John,
> 	  Although I have not yet gotten it to work, I've been using the
> following for matching mime type image:
> 
> match protocol http mime "*gif"
> match protocol http mime "*jpg"
> 
> As I understand it, this will get the job done.  When asked to get rid of
> GIFs, JPGs or whatever, I've just recently started using the following
(and
> this does in fact work):
> 
> 
> class-map match-any IMAGES
>    match protocol http url "*.gif"
>    match protocol http url "*.jpg"
>    match protocol http mime "*gif"
>    match protocol http mime "*jpg"
> !
> !
>   policy-map QOS
>    class IMAGES
>     drop
> 
> 
> Cisco offers the following example:
> 
> <snip>
> The following example classifies, within class map foo, packets based on
the
> JPEG MIME type:
> 
> class-map foo 
> match protocol http mime "*jpeg"
> 
> </snip>
>
http://www.cisco.com/en/US/products/sw/iosswrel/ps1838/products_feature_guid
> e09186a0080134add.html
> 
> 
> Also:
>
http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_tech_note091
> 86a0080110d17.shtml
> 
> 
> In addition, Scott and some others hashed this out very recently, the
title
> of the thread was "RE: MQC to filter MIME-types" - check the archives
> 
> HTH
> Alsontra
> 
> 
> 
> 
> 
> -----Original Message-----
> From: nobody@xxxxxxxxxxxxxx [mailto:nobody@xxxxxxxxxxxxxx] On Behalf Of
John
> Matus
> Sent: Friday, October 01, 2004 5:43 PM
> To: lab
> Subject: matching pictures w/ mime
> 
> is this the correct syntax for matting images with mime?
> 
> class-map match-all image
>     match proto http mime "image/*"
> 
> i'm used to matching with 'http url "*.jpg*", so i want to make sure the
> syntax is right.
> 
> 
> Regards,
> 
> John D. Matus
> MCSE, CCNP
> Office: 818-782-2061
> Cell: 818-430-8372
> jmatus@xxxxxxxxxxx
> 
> _______________________________________________________________________
> Subscription information may be found at: 
> http://www.groupstudy.com/list/CCIELab.html
> 
> _______________________________________________________________________
> Subscription information may be found at: 
> http://www.groupstudy.com/list/CCIELab.html
> 

-- 
Carlos G Mendioroz  <tron@xxxxxxxxxxx>  LW7 EQI  Argentina

_______________________________________________________________________
Subscription information may be found at: 
http://www.groupstudy.com/list/CCIELab.html