Skip to content

BUG + FIX: Adding header via JS API not working - let me propose fix for that #244

@kamilkodzi

Description

@kamilkodzi

Hi, i fund bug in code. not working scenario:

import { loadTest } from 'loadtest';

const options = {
  url: 'http://localhost:3000/product',
  maxRequests: 1,
  body: JSON.stringify({ id: 1 }),
  method: 'POST',
  headers: {
    'content-type': 'application/json',
  },
};

const result = await loadTest(options);

// result.show();
console.log('Tests run successfully');

With this on server side comes: text/plain. loadtest is not aware of new header due to this lines of code. After this all works properly <3

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions