Last Comment Bug 771132 - YouSendIt uploads return busted Filelink URLs
: YouSendIt uploads return busted Filelink URLs
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: FileLink (show other bugs)
: 14 Branch
: x86 All
: -- critical (vote)
: Thunderbird 16.0
Assigned To: Mike Conley (:mconley) - (needinfo me!)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-05 07:04 PDT by Mike Conley (:mconley) - (needinfo me!)
Modified: 2012-07-11 11:27 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
+
fixed
+
fixed


Attachments
Patch v1 (5.61 KB, patch)
2012-07-09 07:01 PDT, Mike Conley (:mconley) - (needinfo me!)
bwinton: review+
standard8: approval‑comm‑aurora+
standard8: approval‑comm‑beta+
Details | Diff | Splinter Review

Description Mike Conley (:mconley) - (needinfo me!) 2012-07-05 07:04:09 PDT
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
Comment 1 Mike Conley (:mconley) - (needinfo me!) 2012-07-09 07:01:45 PDT
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.
Comment 2 Mark Banner (:standard8) 2012-07-11 04:55:17 PDT
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.
Comment 3 Blake Winton (:bwinton) (:☕️) 2012-07-11 10:48:45 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.