Skip to content

Commit 0e0ba5d

Browse files
committed
Change default Content-Disposition type from 'inline' to 'attachment'
1 parent 4f989e8 commit 0e0ba5d

4 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/Dibix.Sdk.CodeGeneration/Registration/ControllerDefinitionProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private static bool TryReadFileResponse(JObject action, out ActionFileResponse f
374374
bool cache = (bool?)cacheProperty?.Value ?? true;
375375
SourceLocation? indentJson = (bool?)indentJsonProperty?.Value == true ? indentJsonProperty.GetSourceInfo() : null;
376376
if (!Enum.TryParse((string)fileResponseValue.Property("dispositionType")?.Value, true, out ContentDispositionType dispositionType))
377-
dispositionType = ContentDispositionType.Inline;
377+
dispositionType = ContentDispositionType.Attachment;
378378

379379
fileResponse = new ActionFileResponse(mediaType, cache, dispositionType, indentJson);
380380
location = fileResponseProperty.GetSourceInfo();

tests/Dibix.Sdk.Tests.Database/Endpoints/GenericEndpoint.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@
9595
"fileResponse": {
9696
"mediaType": "image/*",
9797
"cache": false,
98-
"indentJson": false,
99-
"dispositionType": "attachment"
98+
"indentJson": false
10099
},
101100
"authorization": "none"
102101
},

tests/Dibix.Sdk.Tests.Database/Endpoints/GenericEndpointReflection.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"fileResponse": {
4343
"mediaType": "image/*",
4444
"cache": false,
45-
"dispositionType": "attachment"
45+
"dispositionType": "inline"
4646
}
4747
}
4848
]

tests/Dibix.Sdk.Tests/Resources/CodeGeneration/Endpoints_Accessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public override void Configure(IHttpApiDiscoveryContext context)
336336
action.Method = HttpApiMethod.Get;
337337
action.ChildRoute = "Reflection/File/{id}";
338338
action.SecuritySchemes.Add("DibixBearer");
339-
action.FileResponse = new HttpFileResponseDefinition(cache: false, dispositionType: ContentDispositionType.Attachment, indentJson: false);
339+
action.FileResponse = new HttpFileResponseDefinition(cache: false, dispositionType: ContentDispositionType.Inline, indentJson: false);
340340
});
341341
});
342342
}

0 commit comments

Comments
 (0)