question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

~0.9 to ~1.0 breaking changes: unable to return raw content

See original GitHub issue

Problem

Same code with ~0.9 returns:

{"swagger":"2.0","info":{"version":"0.5.0","title":"test"},"host":"...

Now with ~1.0 I have everything in double quotes with escaped characters… ?!

"{\"swagger\":\"2.0\",\"info\":{\"version\":\"0.5.0\",\"title\":\"test\"},\"host\":\"...

What happened? I can see no “breaking changes” in your 1.0 release

Edit: Related to issues https://github.com/Azure/azure-webjobs-sdk-script/issues/958 (and https://github.com/Azure/azure-webjobs-sdk-script/issues/814)

Workaround

Switch back to ~0.9

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
fabiocavcommented, Nov 23, 2016

For reference, here is an example of that in use:

  context.res = {
            status: 200,
            body: '<root>body</root>',
            headers: {
                'Content-Type': 'text/xml'
            },
            isRaw: true
        }

We have also added a function to allow you to easily set that on the response. Here’s an example returning JSON:

context.res.type('application/json')
        .raw('{ "prop" : "value" }');

Let us know if you have any problems

1reaction
yvelecommented, Nov 22, 2016

@fabiocav Nop, I need to return raw data. A way to return raw data is vital. It’s so simple you have to break it? Why is Azure Function interfering here? Over-featuring everything… This is really basic needs.

What if I need to return a simple utf-8 string? Impossible? Plus what is the point of returning and escaping double quotes "foo" for a string?! (req.body = "foo";)

You cannot break this over simple functionality and doesn’t give a way to achive it (buffer support is broken). I’m curious what @mathewc is thinking about that… really…

PS: Sorry for my destructured comment but I’m a bit pissed off right now…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set response body to a buffer from Node.js function #958
~0.9 to ~1.0 breaking changes: unable to return raw content #965 ... I can't set a string because of #965 and I can't...
Read more >
CHANGELOG.md - iamhosseindhv/notistack
See Migration guide for a full list of breaking changes with instruction on how to upgrade to v3.
Read more >
error NU1102: Unable to find package NuGet.Frameworks ...
I had a package I made with version 0.8.3, 0.9.0, and 0.9.1. They did have some breaking changes in each version. So the...
Read more >
Changelog | Cypress Documentation
Experimental Breaking Changes: Updates were made to enhance the cy.session() recovered error experience. With this change, cy.session() will no longer fail ...
Read more >
What's new in 1.0.0 (January 29, 2020)
Deprecations will be enforced in major releases (e.g. 1.0.0, 2.0.0, 3.0.0, …) API-breaking changes will be made only in major releases (except for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found