contentType.otherTextualTypes does not accept multipart
search cancel

contentType.otherTextualTypes does not accept multipart

book

Article ID: 420188

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

After upgrading at startup of the API Gateway 11.1.2 appliance, we are seeing the following  warnings.

==============================
  com.l7tech.server.SimplePropertyChangeHandler
==============================
com.l7tech.server.SimplePropertyChangeHandler: 2420: Cannot parse content-type value 'multipart/form-data; charset="UTF-8"' from cluster property. Reason: Content-Type of type multipart must include a boundary parameter (RFC 2045 sec 5)
com.l7tech.server.SimplePropertyChangeHandler: 2420: Cannot parse content-type value 'multipart/form-data' from cluster property. Reason: Content-Type of type multipart must include a boundary parameter (RFC 2045 sec 5)

The cwp contentType.otherTextualTypes  is set to 

multipart/form-data; charset="UTF-8"
multipart/form-data
multipart/x-mixed-replace;boundary=End
application/javascript

but the boundary in the Content-Type header is a dynamic value.

In the configuration, how should the entries be defined so that the Content-Type values

 
 

 

Environment

Gateway 11.1.x

Resolution

The multipart/form-data is already known to gateway by default and there should be no need to add it to contentType.otherTextualTypes

One of the main intent of this cluster property is to treat unknown content types as textual so that evaluating ${<message>.mainpart} will yield data.

For multipart body in the request.mainpart 

see the following section in the docs

https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/11-1/reference/context-variables/message-layer-context-variables.html

${<target>.mainpart}    Returns the body of the main/root MIME part, including any attachments; turns the message into a String.

It will only show the data for the first mainpart if the content is textual .

the other parts of this multiparts  can be accessed by using for example :

${request.mainpart}
${request.mainPart.contentType}
========================part1==
${request.parts.1.size}
${request.parts.1.contentType}
${request.parts.1.body}
========================Part2==
${request.parts.2.size}
${request.parts.2.contentType}
${request.parts.2.body}
========================Part3==
${request.parts.3.size}
${request.parts.3.contentType}
${request.parts.3.body}

If you do not manipulate the request body content it will route all parts in the routing to the backend .