-
Notifications
You must be signed in to change notification settings - Fork 82
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
Case insensitive Content-Type not handled as html #20
Comments
I think this is the same as mailhog/MailHog#113, and should be fixed by c2d0e00 Let me know if it's still broken after the next release |
Hi @ian-kent - The case sensitivity of the header keys is still an issue. It appears the code uses Content-Type explicitly in numerous places: Perhaps instead of the patch above, a fix that modifies the for(var header in message.Content.Headers) {
if(header.toLowerCase() == 'content-type' && header != 'Content-Type') {
message.Content.Headers['Content-Type'] = message.Content.Headers[header];
delete message.Content.Headers[header];
break;
}
} Or, perhaps just make all titlecase: for(var header in message.Content.Headers) {
var parts = header.split("-");
for (var part in parts) {
var s = parts[part];
parts[part] = s.charAt(0).toUpperCase() + s.substr(1).toLowerCase();
}
var newHeader = parts.join("-");
if(header =! newHeader) {
message.Content.Headers[newHeader] = message.Content.Headers[header];
delete message.Content.Headers[header];
}
} |
The problem still exist. Why can't this be solved? |
@ian-kent since you asked, just wanted to let you know that it's still an issue |
For years |
If mailer uses
content-type
,Content-type
instead ofContent-Type
message will not be displayed as html since case sensitive key match is being used in controller.js.The text was updated successfully, but these errors were encountered: