prism: Passthrough Binary Request/Response Bodies

User story.

As a developer, I can proxy requests/responses with binary bodies, so that I can still proxy all requests through prism-cli proxy without having to write reverse proxy rules to ignore certain routes.

Is your feature request related to a problem?

I’m using apache as a reverse proxy for our app and I’m required to write additional proxy rules for routes which have requests/responses containing binary body data so that prism doesn’t distort the payloads.

Describe the solution you’d like

For me, prism would ideally ignore body validation when Content-Type is set to application/octet-stream so that basic endpoint validation can still be confirmed i.e. “does the endpoint we’re hitting exist in the openapi.yaml file?”

Additional context

I’ve read through some issues which show that binary bodies are not a priority but it would be helpful if there was a way to transparently passthrough the data so these routes could still be used with the prism proxy.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments

That’ll work I think! proxy is a CLI and HTTP Server feature not a HTTP Client feature anyway, right? Or did i forget.

– Phil Sturgeon DevRel @ Stoplight.io

On Sep 11, 2020, at 21:01, Vincenzo Chianese notifications@github.com wrote:

@philsturgeon I can definitely take a look.

Notes to myself next week:

Prism Http does not have access to the request object anymore; therefore every http proxy on the Node ecosystem will not work.

On the other hand is to implement this in the http-server package. If the content-type header is effectively an octet stream, just proxy directly from the http server, and skip everything else.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.