Closed Bug 771132 Opened 12 years ago Closed 12 years ago

YouSendIt uploads return busted Filelink URLs

Categories

(Thunderbird :: FileLink, defect)

14 Branch
x86
All
defect
Not set
critical

Tracking

(thunderbird14+ fixed, thunderbird15+ fixed)

RESOLVED FIXED
Thunderbird 16.0
Tracking Status
thunderbird14 + fixed
thunderbird15 + fixed

People

(Reporter: mconley, Assigned: mconley)

Details

Attachments

(1 file)

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
Attached patch Patch v1Splinter Review
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)
Version: 15 → 14
Severity: normal → critical
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
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 16.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: