Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
- CLI: 2.1
- Cross-platform modules: 2.1
- Runtime(s): 2.1.1
Please tell us how to recreate the issue in as much detail as possible.
I am attaching a sample project.
- Run server with npm run start
- Adjust server IP for your emulator/device in app.component.ts.
- Run client app with cd header-test; tns run android
- Tap the button - it will issue a HTTP request
The node server will return a response that has two Header1 headers set. The correct implementation should return a ["one", "two"] value when requesting the headers. It returns ["two", "two"] instead.
It seems the Java HTTP library we use for Android returns the wrong value. Adding a log statement to header extraction:
if (result.headers) {
var jHeaders = result.headers;
var length = jHeaders.size();
var i;
var pair;
for (i = 0; i < length; i++) {
pair = jHeaders.get(i);
console.log("GOT HEADER: " + pair.key + " = " + pair.value);
http.addHeader(headers, pair.key, pair.value);
}
}
Yields this:
JS: GOT HEADER: Header1 = two
JS: GOT HEADER: Header1 = two
http-headers.zip
Reactions are currently unavailable
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
Please tell us how to recreate the issue in as much detail as possible.
I am attaching a sample project.
The node server will return a response that has two Header1 headers set. The correct implementation should return a ["one", "two"] value when requesting the headers. It returns ["two", "two"] instead.
It seems the Java HTTP library we use for Android returns the wrong value. Adding a log statement to header extraction:
Yields this:
http-headers.zip