Attachments urls in emails begin with https, despite it not being activated


(Kolt) #1

In emails that contain a link to an attachment, the attachment url points to https despite it not being activated in Discourse. When viewed through Discourse, the attachment file urls are correctly pointing towards http://… .


Links in mail lack http(s) protocol
(Jeff Atwood) #2

@zogstrip can you have a look? I don’t think I’ve ever gotten an email notification about a reply with an attachment.


(Wes Osborn) #3

I just saw this in my testing as well. Here is what the source of the notification email looks like:

<a href="//discourse.clcohio.org/uploads/default/5/eec1c369aff39755.xlsx" style="text-decoration: none; font-weight: bold; color: #006699;">paperbacks.xlsx</a> (9.81 KB)</p></td>

So it appears that the issue is the a href doesn’t start with http: and because I’m viewing it in gmail over an https connection that is what the browser assumes I want to connect to the other URL using.


(Tobias Eigen) #4

I just discovered this bug too. https is turned off in the discourse settings. I guess I need to get https working on my digitalocean site and this problem will go away. :wink:

But in the meantime I do think this is a bug. What I did:

  • created topic on my discourse with some internal and external links

  • Verified both internal and external links have full URLs in markdown

  • Viewing source of page, external links are full URLs but internal links look like this. Both internal and external links work fine on the site.

    <a href="//discourse.kabissa.org/t/introductions-and-q-a-for-africa-roundtable-on-29-may-2014-civicrm/865/16">this dedicated topic in the forum</a>

  • In my email source, the plain text version of both internal and external links look good!

  • But in my email source, the HTML version of external links work fine but internal links are broken as above.


(Jeff Atwood) #5

Are you talking about attachments? This topic is about attachments.

I don’t see any attachments in the post you reference?


(Tobias Eigen) #6

No attachments, you are right. Seems to me the bug is bigger than just
attachments since my internal to discourse urls look just like the example
with attachments. Or it is indeed a different bug.


(Jeff Atwood) #7

It’s just that protocol agnostic URLs, like you use on the web, aren’t a good idea in emails.


(Tobias Eigen) #8

that’s why I think this is a bug - I did not use protocol agnostic URLs in my posts. But they were converted into protocol agnostic URLs by discourse.


(Jeff Atwood) #9

I thought we fixed this @techapj can you verify?


(Arpit Jalan) #10

Yes, this issue was fixed via:

https://github.com/discourse/discourse/commit/370f50250b963defb1c449d11695e4e4b1cadd20


(Arpit Jalan) #11