File tree Expand file tree Collapse file tree 6 files changed +55
-7
lines changed
private/aws-protocoltests-restxml Expand file tree Collapse file tree 6 files changed +55
-7
lines changed Original file line number Diff line number Diff line change 8282 "license" : " Apache-2.0" ,
8383 "dependencies" : {
8484 "@aws-sdk/types" : " workspace:^3.973.6" ,
85- "@aws-sdk/xml-builder" : " workspace:^3.972.12 " ,
85+ "@aws-sdk/xml-builder" : " workspace:^3.972.13 " ,
8686 "@smithy/core" : " ^3.23.12" ,
8787 "@smithy/node-config-provider" : " ^4.3.12" ,
8888 "@smithy/property-provider" : " ^4.2.12" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @aws-sdk/xml-builder" ,
3- "version" : " 3.972.12 " ,
3+ "version" : " 3.972.13 " ,
44 "description" : " XML utilities for the AWS SDK" ,
55 "dependencies" : {
66 "@smithy/types" : " ^4.13.1" ,
Original file line number Diff line number Diff line change @@ -169,6 +169,44 @@ describe("xml parsing", () => {
169169 } ) ;
170170 }
171171
172+ it ( "can parse a large amount of XML including entities" , ( ) => {
173+ const xml = `<?xml version="1.0" encoding="UTF-8"?>
174+ <ListBucketResult>
175+ <IsTruncated>boolean</IsTruncated>
176+ <Marker>string</Marker>
177+ <NextMarker>string</NextMarker>
178+ <Contents>
179+ ${ `<Object>
180+ <ChecksumAlgorithm>string</ChecksumAlgorithm>
181+ <ChecksumType>string</ChecksumType>
182+ <ETag>"098f6bcd4621d373cade4e832627b4f6"</ETag>
183+ <Key>string</Key>
184+ <LastModified>timestamp</LastModified>
185+ <Owner>
186+ <DisplayName>string</DisplayName>
187+ <ID>string</ID>
188+ </Owner>
189+ <RestoreStatus>
190+ <IsRestoreInProgress>boolean</IsRestoreInProgress>
191+ <RestoreExpiryDate>timestamp</RestoreExpiryDate>
192+ </RestoreStatus>
193+ <Size>long</Size>
194+ <StorageClass>string</StorageClass>
195+ </Object>` . repeat ( 2000 ) }
196+ </Contents>
197+ <Name>string</Name>
198+ <Prefix>string</Prefix>
199+ <Delimiter>string</Delimiter>
200+ <MaxKeys>integer</MaxKeys>
201+ <CommonPrefixes>
202+ <Prefix>string</Prefix>
203+ </CommonPrefixes>
204+ <EncodingType>string</EncodingType>
205+ </ListBucketResult>` ;
206+
207+ expect ( parseXMLBrowser ( xml ) ) . toEqual ( parseXML ( xml ) ) ;
208+ } ) ;
209+
172210 it ( "throws on parsing error" , ( ) => {
173211 const xmlSamples = [ `<unclosed` , `<unmatched></matched>` ] ;
174212
Original file line number Diff line number Diff line change 11import { XMLParser } from "fast-xml-parser" ;
22
3+ /**
4+ * Because this is only used against trusted server responses,
5+ * we should not be setting any client side limits.
6+ *
7+ * @internal
8+ */
39const parser = new XMLParser ( {
410 attributeNamePrefix : "" ,
11+ processEntities : {
12+ enabled : true ,
13+ maxTotalExpansions : Infinity ,
14+ } ,
515 htmlEntities : true ,
616 ignoreAttributes : false ,
717 ignoreDeclaration : true ,
818 parseTagValue : false ,
919 trimValues : false ,
1020 tagValueProcessor : ( _ : any , val : any ) => ( val . trim ( ) === "" && val . includes ( "\n" ) ? "" : undefined ) ,
11- maxNestedTags : 1024 ,
21+ maxNestedTags : Infinity ,
1222} ) ;
1323parser . addEntity ( "#xD" , "\r" ) ;
1424parser . addEntity ( "#10" , "\n" ) ;
Original file line number Diff line number Diff line change 3333 "@aws-sdk/util-endpoints" : " workspace:^3.996.5" ,
3434 "@aws-sdk/util-user-agent-browser" : " workspace:^3.972.8" ,
3535 "@aws-sdk/util-user-agent-node" : " workspace:^3.973.8" ,
36- "@aws-sdk/xml-builder" : " workspace:^3.972.12 " ,
36+ "@aws-sdk/xml-builder" : " workspace:^3.972.13 " ,
3737 "@smithy/config-resolver" : " ^4.4.11" ,
3838 "@smithy/core" : " ^3.23.12" ,
3939 "@smithy/fetch-http-handler" : " ^5.3.15" ,
Original file line number Diff line number Diff line change @@ -1201,7 +1201,7 @@ __metadata:
12011201 "@aws-sdk/util-endpoints": "workspace:^3.996.5"
12021202 "@aws-sdk/util-user-agent-browser": "workspace:^3.972.8"
12031203 "@aws-sdk/util-user-agent-node": "workspace:^3.973.8"
1204- "@aws-sdk/xml-builder": "workspace:^3.972.12 "
1204+ "@aws-sdk/xml-builder": "workspace:^3.972.13 "
12051205 "@smithy/config-resolver": "npm:^4.4.11"
12061206 "@smithy/core": "npm:^3.23.12"
12071207 "@smithy/fetch-http-handler": "npm:^5.3.15"
@@ -23535,7 +23535,7 @@ __metadata:
2353523535 resolution: "@aws-sdk/core@workspace:packages-internal/core"
2353623536 dependencies:
2353723537 "@aws-sdk/types": "workspace:^3.973.6"
23538- "@aws-sdk/xml-builder": "workspace:^3.972.12 "
23538+ "@aws-sdk/xml-builder": "workspace:^3.972.13 "
2353923539 "@smithy/core": "npm:^3.23.12"
2354023540 "@smithy/node-config-provider": "npm:^4.3.12"
2354123541 "@smithy/property-provider": "npm:^4.2.12"
@@ -25086,7 +25086,7 @@ __metadata:
2508625086 languageName: unknown
2508725087 linkType: soft
2508825088
25089- "@aws-sdk/xml-builder@workspace:^3.972.12 , @aws-sdk/xml-builder@workspace:packages-internal/xml-builder":
25089+ "@aws-sdk/xml-builder@workspace:^3.972.13 , @aws-sdk/xml-builder@workspace:packages-internal/xml-builder":
2509025090 version: 0.0.0-use.local
2509125091 resolution: "@aws-sdk/xml-builder@workspace:packages-internal/xml-builder"
2509225092 dependencies:
You can’t perform that action at this time.
0 commit comments