Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Find a way how to work with binary files in hooks #617

Closed
@aledeg

Description

@aledeg

I don't know if I should open that ticket here or here.

I am trying to change the request body with the content of a file with a hook, but it does not work.
I have the following error:

SyntaxError: Unexpected end of input
  at Object.parse (native)
  at Socket.<anonymous> (/usr/lib/node_modules/dredd/lib/hooks-worker-client.js:268:34)
  at emitOne (events.js:90:13)
  at Socket.emit (events.js:182:7)
  at readableAddChunk (_stream_readable.js:153:18)
  at Socket.Readable.push (_stream_readable.js:111:10)
  at TCP.onread (net.js:534:20)

This is what I have in my hook:

$transaction->request->body = file_get_contents($filename);

Is this the good way of doing that?

Ping @ddelnano

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions