Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/net/Areas/Subscriber/Controllers/ContentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public async Task<IActionResult> DownloadFileAsync(long id)
[SwaggerOperation(Tags = new[] { "Content" })]
public IActionResult AnonymousDownloadFile(string path)
{
var ext = Path.GetExtension(path).Substring(1);
var ext = Path.GetExtension(path).TrimStart('.');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue when the file doesn't include an extension

if (!_storageOptions.AllowAnonymousDownloadFileTypes.Any(value => String.Equals(value, ext, StringComparison.OrdinalIgnoreCase))) throw new InvalidOperationException("Unable to download file.");

path = String.IsNullOrWhiteSpace(path) ? "" : HttpUtility.UrlDecode(path).MakeRelativePath();
Expand Down
5 changes: 4 additions & 1 deletion libs/net/template/ReportEngine.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

using System.Globalization;
using System.IO.Compression;
using System.Net;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
Expand Down Expand Up @@ -532,8 +533,10 @@ await report.Sections

await File.WriteAllBytesAsync(fullPath, imageBytes);

var urlPathToImage = WebUtility.UrlEncode(pathToImage);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed bug when file name includes invalid characters like &, ?, =


// Update the section to include the new image.
sectionData.Settings.UrlCache = this.TemplateOptions.SubscriberAppUrl?.Append($"api/subscriber/contents/download?path={pathToImage}").AbsoluteUri;
sectionData.Settings.UrlCache = this.TemplateOptions.SubscriberAppUrl?.Append($"api/subscriber/contents/download?path={urlPathToImage}").AbsoluteUri;
}
}
else
Expand Down
4 changes: 2 additions & 2 deletions openshift/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ podsExtractQuotes=$(getPods extract-quotes-service deployment $env)
podsFolderCollection=$(getPods folder-collection-service deployment $env)
podsContent=$(getPods content-service deployment $env)
podsIndexing=$(getPods indexing-service deployment $env)
if [ "$env" != "dev "]; then
if [[ "$env" != "dev " ]]; then
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed DevOps bug

podsIndexingCloud=$(getPods indexing-service-cloud deployment $env)
fi
podsEventHandler=$(getPods event-handler-service deployment $env)
Expand Down Expand Up @@ -139,7 +139,7 @@ scale extract-quotes-service $podsExtractQuotes deployment $env
scale folder-collection-service $podsFolderCollection deployment $env
scale content-service $podsContent deployment $env
scale indexing-service $podsIndexing deployment $env
if [ "$env" != "dev" ]; then
if [[ "$env" != "dev" ]]; then
scale indexing-service-cloud $podsIndexingCloud deployment $env
fi
scale event-handler-service $podsEventHandler deployment $env
Expand Down
Loading