Skip to content

Commit 3d00ce2

Browse files
committed
Fix bugs (bcgov#2547)
1 parent cdb5bb3 commit 3d00ce2

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

api/net/Areas/Subscriber/Controllers/ContentController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public async Task<IActionResult> DownloadFileAsync(long id)
202202
[SwaggerOperation(Tags = new[] { "Content" })]
203203
public IActionResult AnonymousDownloadFile(string path)
204204
{
205-
var ext = Path.GetExtension(path).Substring(1);
205+
var ext = Path.GetExtension(path).TrimStart('.');
206206
if (!_storageOptions.AllowAnonymousDownloadFileTypes.Any(value => String.Equals(value, ext, StringComparison.OrdinalIgnoreCase))) throw new InvalidOperationException("Unable to download file.");
207207

208208
path = String.IsNullOrWhiteSpace(path) ? "" : HttpUtility.UrlDecode(path).MakeRelativePath();

libs/net/template/ReportEngine.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
using System.Globalization;
33
using System.IO.Compression;
4+
using System.Net;
45
using System.Text;
56
using System.Text.Json;
67
using System.Text.Json.Nodes;
@@ -532,8 +533,10 @@ await report.Sections
532533

533534
await File.WriteAllBytesAsync(fullPath, imageBytes);
534535

536+
var urlPathToImage = WebUtility.UrlEncode(pathToImage);
537+
535538
// Update the section to include the new image.
536-
sectionData.Settings.UrlCache = this.TemplateOptions.SubscriberAppUrl?.Append($"api/subscriber/contents/download?path={pathToImage}").AbsoluteUri;
539+
sectionData.Settings.UrlCache = this.TemplateOptions.SubscriberAppUrl?.Append($"api/subscriber/contents/download?path={urlPathToImage}").AbsoluteUri;
537540
}
538541
}
539542
else

openshift/scripts/deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ podsExtractQuotes=$(getPods extract-quotes-service deployment $env)
4848
podsFolderCollection=$(getPods folder-collection-service deployment $env)
4949
podsContent=$(getPods content-service deployment $env)
5050
podsIndexing=$(getPods indexing-service deployment $env)
51-
if [ "$env" != "dev "]; then
51+
if [[ "$env" != "dev " ]]; then
5252
podsIndexingCloud=$(getPods indexing-service-cloud deployment $env)
5353
fi
5454
podsEventHandler=$(getPods event-handler-service deployment $env)
@@ -139,7 +139,7 @@ scale extract-quotes-service $podsExtractQuotes deployment $env
139139
scale folder-collection-service $podsFolderCollection deployment $env
140140
scale content-service $podsContent deployment $env
141141
scale indexing-service $podsIndexing deployment $env
142-
if [ "$env" != "dev" ]; then
142+
if [[ "$env" != "dev" ]]; then
143143
scale indexing-service-cloud $podsIndexingCloud deployment $env
144144
fi
145145
scale event-handler-service $podsEventHandler deployment $env

0 commit comments

Comments
 (0)