Azure / Azure/Azurite

Azurite's XML responses alter the contents of multi-line text nodes

Open
#156 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue legacy queue-storage
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

Azurite uses [`js2xmlparser`](https://www.npmjs.com/package/js2xmlparser) to convert JavaScript objects to XML, which in turn uses [`xmlcreate`](https://www.npmjs.com/package/xmlcreate). However, `xmlcreate` defaults to pretty-printing XML outputs, which indent XML nodes and _wrongly_ indents the contents of multi-line text nodes by adding spaces before each line.

This behavior can be fixed by passing either `{ format: { pretty: false } }` or `{ format: { indent: '' } }` in any appropriate `js2xmlparser.parse()` calls.

FWIW, I've submitted a new [issue in the `node-xmlcreate` project](https://github.com/michaelkourlas/node-xmlcreate/issues/7). Also, FYI, this issue was [reported in the `node-j2sxmlparser` project](https://github.com/michaelkourlas/node-js2xmlparser/issues/60), but it was dismissed.

Expected behavior (Actual Azure Storage Queue example, edited for brevity):
```xml
[...]This is a test
Another line
More lines
```

Actual Azurite Queue behavior (edited for brevity):
```xml
[...]This is a test
Another line
More lines
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.