Different behaviour when body is missing
See original GitHub issueRepro steps
given the following function.json
{
"entryPoint": "handler",
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [ "get" ],
"route": "embed/{appId}",
"authLevel": "anonymous"
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
],
"disabled": false
}
and the following handler
export function handler(ctx, req) {
return Promise.resolve({
status: 302, headers: { Location: '/new_url' }
})
}
Expected behavior
redirect to /new_url
Actual behavior
returns status 200
, with JSON body: { status: 302, headers: { Location: '/new_url' } }
Known workarounds
adding an empty body causes the redirect to be followed
export function handler(ctx, req) {
return Promise.resolve({
body: '', status: 302, headers: { Location: '/new_url' }
})
}
Is this behaviour intentional? Seems very confusing
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
The Psychology of Missing Someone: 5 Ways to Cope With ...
When you miss someone, your body and brain go through a painful response. The grieving process may affect your appetite, ability to sleep, ......
Read more >Identifying and Treating Maladaptive Behavior
Let's explore some types of maladaptive behavior and signs you should seek treatment. ... They end up missing out on something they enjoy....
Read more >Clinical Manifestations of Body Memories: The Impact ...
Body memories of inescapability and helplessness due to an experienced inability to fight or flee during a traumatic event have therefore been ...
Read more >(PDF) Cognitive-Behavioral Correlates of Psychological ...
Relatives of missing persons (n = 134) completed self-report measures of negative cognitions, avoidance behaviors, PGD, PTSD, and MDD.
Read more >The feeling a limb doesn't belong is linked to lack of brain ...
People with body integrity dysphoria (BID) often feel as though one of their healthy limbs isn't meant to be a part of their...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mamaso didn’t realise you can do
body: undefined
, thanks!Thanks for clarifying! Would personally prefer it to always treat object as response object, for consistency sake. But don’t think its a major issue either way