mohammad
mohammad

Reputation: 521

express gateway doesn't pass multipart/formdata

I'm using express gateway as my gateway to services. one of my services has to update an image. so when I'm using the service alone it accepts files and I use multer to parse them but when it's behind express gateway, the file will be lost and I don't have that in my body afterward. Is there a config for such a thing?

I've used this config but it didn't work:

    policies:
  - request-transformer:
      - action:
            multipart: true
  - cors:
      - action:
          credentials: true

Upvotes: 1

Views: 92

Answers (1)

mohammad
mohammad

Reputation: 521

so after lots of searching, I finally found the problem. the request-transformer policy was the problem and by removing that, it worked just fine and I don't why it caused the problem. so my final pipeline config is like this:

  project:
    apiEndpoints:
      - project
    policies:
      - cors:
          - action:
              credentials: true
      - proxy:
          - action:
              serviceEndpoint: project
              changeOrigin: false

Upvotes: 1

Related Questions