Request constructor should verify that url is valid

RESOLVED FIXED

Status

Add-on SDK
General
P2
normal
RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: erikvold, Assigned: jsantell)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I saw this as a TODO in the source https://github.com/mozilla/addon-sdk/blob/1afc3d73c6e20dc88e9aba91c6ff499d4fcf69ad/lib/sdk/request.js#L27
Blocks: 841629

Updated

5 years ago
Priority: -- → P2
(Assignee)

Updated

5 years ago
Assignee: nobody → jsantell
We could go as hard or as easy as we'd like, seems like this is a fun problem: http://mathiasbynens.be/demo/url-regex

I'd rather a more liberal regex than an overly complex/slow/restrictive one as it'd be worse to not let a valid URL in than to let an invalid one work.
Created attachment 731958 [details]
GH Pull Request 911
Attachment #731958 - Flags: review?(evold)
Comment on attachment 731958 [details]
GH Pull Request 911

Thanks!
Attachment #731958 - Flags: review?(evold) → review+

Comment 4

5 years ago
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/04c2a1196d0c047530b8fe508dc52971d5111bc1
Merge pull request #911 from jsantell/request-url-validation-841628

Fixes Bug 841628, Request Constructor Validates URL, r+=@erikvold

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Oops I forgot that there was an api change here, and Irakli needs to approve that sort of thing.

Can you take a look at this when you have a chance please Irakli?
Flags: needinfo?(rFobic)
Got a thumbs up from Irakli, after changing method name to `isValidURI`
needinfo is no longer relevant, as Jordan said I have replied in pull.
Flags: needinfo?(rFobic)
You need to log in before you can comment on or make changes to this bug.