aws-ia / cloudformation-aws-marketplace-saas

AWS Marketplace Build Tools
Apache License 2.0
25 stars 20 forks source link

Cloudfornt header issue #54

Open lielran opened 1 year ago

lielran commented 1 year ago
Screenshot 2022-12-13 at 16 20 31

Screenshot 2022-12-13 at 20 15 06


(w1f6g52TQqKf0ipOC-3Gc2HelnR72vgScG9mCJ_ticxPbpYHco7Qmw==) ERROR Validation error: Lambda function result validation failed, the function returned an invalid header, invalid character : '%0D' in header value, headerName : Location.
mehmetemreatasever commented 1 year ago

I have the same issue.

MartinEmrich commented 1 year ago

Same here. Digging deeper with my almost nonexistent Lambda skills, I noticed this code fragment in the Lambda@Edge function which seems to handle that request:

     status: '302',
      statusDescription: 'Found',
      headers: {
        location: [{
          key: 'Location',
          value: `/?${body}`,
        }],
      },
    };

So as I read it, it takes the request body (which is multipart form encoded) and attaches it as-is to the redirect Location: header. This data contains multiple CRLF (\r\n).