apigee / microgateway-plugins

Plugins for microgateway, oauth, analytics, spike arrest, etc...
Other
30 stars 54 forks source link

json2xml plugin incorrectly changes request 'content-length' header #184

Open mecclesgoogle opened 4 years ago

mecclesgoogle commented 4 years ago

Lines #137 and #141

The request object has all header names in lower case, but the code uses Capital case.

req.headers['Content-Type'] = ...

This will result in the same header being appended. I.e. it ends up with 'Content-Type' and 'content-type'. The fix should be to assign the header using the lower-case name.

n.b. setHeader(.., ..) method is not available on the IncomingRequest type.