Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std_web_publisher: Check for file download permissions functions will always be true #22

Open
thomas- opened this issue Aug 6, 2019 · 0 comments

Comments

@thomas-
Copy link
Contributor

thomas- commented Aug 6, 2019

Minor find, but I think these two if checks are going to be always true, but it seems the intent is for them to be false if no file download permissions functions are added.

Perhaps it should be if(this._fileDownloadPermissionFunctions.length)?

if(this._fileDownloadPermissionFunctions) {
endLines.push("Disallow: /thumbnail/");
}
} else {
if(this._fileDownloadPermissionFunctions) {
// Special case because file downloads don't use normal publisher handlers
lines.push("Allow: /download/");
}

Publication constructors execute this._setupForFileDownloads();

var Publication = P.Publication = function(name, plugin) {
this.name = name;
this.implementingPlugin = plugin;
this._homePageUrlPath = null;
this._pagePartOptions = {};
this._paths = [];
this._urlPolicy = O.refdictHierarchical();
this._objectTypeHandler = O.refdictHierarchical();
this._searchResultsRenderers = O.refdictHierarchical(); // also this._defaultSearchResultRenderer
this._replacedTemplates = {};
this._setupForFileDownloads();
};

Which sets this._fileDownloadPermissionFunctions = [];

P.Publication.prototype._setupForFileDownloads = function() {
this._fileThumbnailSize = DEFAULT_THUMBNAIL_SIZE;
this._fileDownloadPermissionFunctions = [];
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant