Skip to content

Commit 0be0f22

Browse files
authored
Bugfix upload page & remove dev.azure from allowlist (#8449)
* change condition to support legacy readme or not & remove dev.azure.com from allowlist
1 parent 5d8076c commit 0be0f22

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/NuGetGallery/App_Data/Files/Content/Trusted-Image-Domains.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"codecov.io",
1818
"codefactor.io",
1919
"coveralls.io",
20-
"dev.azure.com",
2120
"gitlab.com",
2221
"img.shields.io",
2322
"isitmaintained.com",

src/NuGetGallery/Scripts/gallery/async-file-upload.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,13 @@
255255
$(reportContainerElement).attr("data-bind", "template: { name: 'verify-metadata-template', data: data }");
256256
$("#verify-package-container").append(reportContainerElement);
257257
ko.applyBindings({ data: model }, reportContainerElement);
258-
if (model.ReadmeFileContents.Content) {
259-
$('#import-readme-container').addClass('hidden');
260-
} else {
258+
//Content of ReadmeFileContents indicates if embedded readme exists in the package.
259+
//Support legacy readme by displaying readme container if ReadmeFileContents is null.
260+
//Disable legacy readme by hiding readme container only if embedded readme content is not null.
261+
if (model.ReadmeFileContents == null) {
261262
$('#import-readme-container').removeClass('hidden');
263+
} else if (model.ReadmeFileContents.Content) {
264+
$('#import-readme-container').addClass('hidden');
262265
}
263266

264267
var submitContainerElement = document.createElement("div");

0 commit comments

Comments
 (0)