Azure / Azure/azure-functions-host

Http query param without value leads to 502 for Javascript functions

Open
#3,709 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

I have an Javascript Azure Function triggered by http(get). In the function i use the property `context.bindingData.sys.methodName`. If i call the function with two query param and one of the param has no value as example `?key=value&key=` the `context.bindingData.sys` object is undefined which gives us 500 internal server error. The whole function app seems to be unresponsive after the first error and has to be restarted to make it work again.

The same code works for azure function version 1.0.

#### Investigative information

Please provide the following:

- Timestamp: 2018-10-29 12:00Z
- Function App version (1.0 or 2.0): 2
- Function App name: akelius-lettingapp-advert-api-dev
- Function name(s) (as appropriate): all
- Invocation ID: happens every time
- Region: Westeurope

#### Repro steps

Provide the steps required to reproduce the problem:
1.) Create Version 2 function app
2.) Create Javascript http triggered function
3.) `const a = context.bindingData.sys.methodName`
4.) Send http get with queryparam `?key=value&key=`

#### Expected behavior

Provide a description of the expected behavior.

No error, success status code
#### Actual behavior

Receive 502 bad gateway
Follow up calls also error.

#### Known workarounds

Provide a description of any known workarounds.

none

#### Related information

Provide any related information

* Programming language used **Javascript**
* Links to source
* Bindings used **http trigger**

Contributor guide

Open the contributing guide

Research direction

Start with a Version 2 JavaScript HTTP-triggered function and reproduce the issue using the documented request `?key=value&key=` while accessing `context.bindingData.sys.methodName`. Done means the request returns a successful status, `context.bindingData.sys` is available, and follow-up calls remain responsive without restarting the Function App.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, javascript
Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.