[SRX/vSRX] Unable to configure MIME-pattern object ending in special characters

  [KB32295] Show Article Properties


Summary:

This article describes what happens when an attempt is made to block a MIME pattern that ends with a special character, suggests a solution, and lists the acceptable MIME object patterns.

 

Symptoms:

When an attempt is made to configure a MIME_pattern value that ends with a special character, Junos OS gives the following error:

vSRX#set security utm custom-objects mime-pattern TEST value audio/amr-wb+

error: value: 'audio/amr-wb+': Must be two strings split by the slash(/). The first string beginning with a letter or number and consisting of letters, numbers, underscores and dashes. Dashes cannot be shown continuously in the first string.
The second string can be null or begin with a letter or number and consisting of letters, numbers, underscores, dashes, dots and pluses. Dashes, dots and pluses can't be shown continuously in the second string.
error: statement creation failed: audio/amr-wb+

 

Cause:

After RFC compliance [RFC-2046 ] was implemented, only the "/" character and no other special characters are permitted at the end of a MIME-pattern object in Junos OS.

 

Solution:

To avoid the Junos OS error, do not use special characters that are not permitted.

Examples of acceptable MIME-pattern values are:

  • vSRX# set security utm custom-objects mime-pattern TEST value audio/ <<< This will match the prefix of the pattern.
  • vSRX# set security utm custom-objects mime-pattern TEST value audio  <<< This will be an exact match.
  • vSRX# set security utm custom-objects mime-pattern TEST value audio/amr-wb <<<<< Example of an exact match for two strings.

Note the following:

  • A MIME entry is case-insensitive.

  • An empty MIME is an invalid entry and should never appear in the MIME list.

  • If a MIME entry ends with a "/" character, prefix matching takes place. Otherwise, exact matching occurs.

 

Related Links: