mirror of https://github.com/grpc/grpc-node.git
Merge pull request #1414 from murgatroid99/grpc-js_dont_split_metadata
grpc-js: Don't split header values by commas
This commit is contained in:
commit
6c298d3a78
|
@ -278,11 +278,7 @@ export class Metadata {
|
|||
result.add(key, value);
|
||||
});
|
||||
} else if (values !== undefined) {
|
||||
if (isCustomMetadata(key)) {
|
||||
values.split(',').forEach((v) => result.add(key, v.trim()));
|
||||
} else {
|
||||
result.add(key, values);
|
||||
}
|
||||
result.add(key, values);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
@ -295,6 +295,7 @@ describe('Metadata', () => {
|
|||
key1: 'value1',
|
||||
key2: ['value2'],
|
||||
key3: ['value3a', 'value3b'],
|
||||
key4: ['part1, part2'],
|
||||
'key-bin': [
|
||||
'AAECAwQFBgcICQoLDA0ODw==',
|
||||
'EBESExQVFhcYGRobHB0eHw==',
|
||||
|
@ -307,6 +308,7 @@ describe('Metadata', () => {
|
|||
['key1', ['value1']],
|
||||
['key2', ['value2']],
|
||||
['key3', ['value3a', 'value3b']],
|
||||
['key4', ['part1, part2']],
|
||||
[
|
||||
'key-bin',
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue