Fixed
Details
Assignee
Michael OffnerMichael OffnerReporter
Brad WoodBrad WoodPriority
MajorFix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Brad Wood
Brad WoodPriority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Created 9 March 2018 at 23:31
Updated 17 August 2021 at 13:24
Resolved 9 April 2019 at 17:52
The content type application/octet-stream is supposed to represent binary, but apparently it is also used by many web servers as a default MIME type if it really doesn't know better.
Lucee incorrectly identifies HTTP responses of type application/octet-stream as plain text instead of binary which causes a very nasty error when you try to install an extension whose actual lex download URL returns application/octet-stream. Lucee tries to use the actual binary of the file as the local path which causes the entire binary file to be output to the browser as part of the error message!!!
My first suggestion is to improve cfthttps detection of plain text, but if that causes issues with backwards compat, at least the improve the extension installation to be smarter. This example code will show the issue.
http url="http://s3.amazonaws.com/downloads.ortussolutions.com/ortussolutions/couchbase-extension/test_file.lex" result="local.http"; dump( local.http.mimetype ); // outputs application/octet-stream dump( isSImpleValue( local.http.filecontent ) ); // Outputs true (incorrect) dump( local.http.text ); // Outputs true (incorrect)
And here is the code in Lucee's Admin.java that is messing up the extension installation:
// this can be a binary that represent the extension or a string that is a path to the extension Object obj = getObject("admin", "UpdateRHExtensions", "source"); // path if(obj instanceof String) { Resource src = ResourceUtil.toResourceExisting(config, (String)obj); XMLConfigAdmin._updateRHExtension(config, src, true); }