Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON response string failed to assert with res.body eq #3758

Open
2 tasks done
MarcHagen opened this issue Jan 8, 2025 · 1 comment
Open
2 tasks done

JSON response string failed to assert with res.body eq #3758

MarcHagen opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@MarcHagen
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

Still worked in: v1.37.0
Broke in: v1.38.0

I've some endpoints that return the raw value "ok" with Header content-type application/json.

The assertion res.body eq ok now fails (after
res.body eq "ok" also fails
res.body: eq ""ok"" succeeds...

Suspected PRs: #3706, #3676 but maybe others or more.

.bru file to reproduce the bug

<?php

header('Content-Type: application/json');
echo json_encode('ok');
meta {
  name: OPTIONS
  type: http
  seq: 1
}

options {
  url: http://localhost:8080
  body: none
  auth: inherit
}

assert {
  res.status: eq 200
  res.body: eq ok
}

Screenshots/Live demo link

image

@MarcHagen MarcHagen added the bug Something isn't working label Jan 8, 2025
@anusree-bruno anusree-bruno self-assigned this Jan 9, 2025
@Pragadesh44-Bruno
Copy link
Contributor

Hey @MarcHagen, We have started working on this. It seems that our improvements in parsing responses have caused this issue. This will be fixed in the upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants