The default bug view has changed. See this FAQ.

YouSendIt uploads return busted Filelink URLs

RESOLVED FIXED in Thunderbird 16.0

Status

Thunderbird
FileLink
--
critical
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mconley, Assigned: mconley)

Tracking

14 Branch
Thunderbird 16.0
x86
All

Thunderbird Tracking Flags

(thunderbird14+ fixed, thunderbird15+ fixed)

Details

Attachments

(1 attachment)

STR:

1) Upload a file to YouSendIt via Filelink

What happens?

The link returned from YouSendIt is in the form of:

www.yousendit.com/download/QlVpQk16Rnd3NUtwSHNUQw

as opposed to:

https://www.yousendit.com/download/QlVpQk16Rnd3NUtwSHNUQw
Assignee: nobody → mconley
Created attachment 640201 [details] [diff] [review]
Patch v1

This patch detects if YSI returns a malformed URI, and if so, automatically prefixes with https://.

It's not exactly pretty, but it makes Filelinks work in TB again.

Includes tests.
Attachment #640201 - Flags: review?(mbanner)
tracking-thunderbird14: --- → ?
tracking-thunderbird15: --- → ?
Version: 15 → 14
Severity: normal → critical
tracking-thunderbird14: ? → +
tracking-thunderbird15: ? → +
Comment on attachment 640201 [details] [diff] [review]
Patch v1

[Triage Comment]
I'm deferring this to Blake as I haven't got time to finish testing due to auth issues, but assuming it passes then you have a=me to land on aurora & beta.
Attachment #640201 - Flags: review?(mbanner)
Attachment #640201 - Flags: review?(bwinton)
Attachment #640201 - Flags: approval-comm-beta+
Attachment #640201 - Flags: approval-comm-aurora+
Comment on attachment 640201 [details] [diff] [review]
Patch v1

>+++ b/mail/components/cloudfile/nsYouSendIt.js
>@@ -1134,30 +1133,53 @@ nsYouSendItFileUploader.prototype = {
>       else if (uploadInfo.clickableDownloadUrl) {
>-        this.youSendIt._urlsForFiles[this.file.path] = uploadInfo.clickableDownloadUrl;
>+        // Bug 771132
>+        // We need a kludge here because YSI is returning URLs without the
>+        // scheme...

I don't think we need the bug number here, because "hg blame" should give us the info.
And feel free to put the comment on a single line.  ;)

>+  _ensureScheme: function nsYSIFU__ensureScheme(aURL) {
>+    try {
>+      let scheme = Services.io.extractScheme(aURL);
>+      return aURL;
>+    } catch(e) {
>+      // If we got NS_ERROR_MALFORMED_URI back, there's no scheme here.

I wonder if that's the only way they could malform the url…
Reading the extractScheme code, it seems that that's the only thing it checks for, though, so let's not handle further error cases until they happen, and we see what they are.

So, other than the comment it looks good.  r=me!

Thanks,
Blake.
Attachment #640201 - Flags: review?(bwinton) → review+
Thanks!

comm-central: https://hg.mozilla.org/comm-central/rev/760988db17f7
comm-aurora: https://hg.mozilla.org/releases/comm-aurora/rev/4ff30bb2f4e2
comm-beta: https://hg.mozilla.org/releases/comm-beta/rev/281b623d3b9f
Status: NEW → RESOLVED
Last Resolved: 5 years ago
status-thunderbird14: --- → fixed
status-thunderbird15: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 16.0
You need to log in before you can comment on or make changes to this bug.