Skip to content

Commit

Permalink
Revert custom request module
Browse files Browse the repository at this point in the history
Update to updated request module with anonymous support.
  • Loading branch information
PerfectSlayer committed Oct 22, 2015
1 parent 7f5ffd3 commit 7aa0938
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 244 deletions.
234 changes: 0 additions & 234 deletions lib/anon-request.js

This file was deleted.

20 changes: 10 additions & 10 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const Base64 = require('sdk/base64');
const Notifications = require('sdk/notifications');
const Panel = require('sdk/panel');
const Request = require('anon-request').Request;
const Request = require('sdk/request').Request;
const SimplePrefs = require('sdk/simple-prefs');
const SimpleStorage = require('sdk/simple-storage');
const Self = require('sdk/self');
Expand Down Expand Up @@ -44,7 +44,7 @@ var freebox = {
discover: function(callback) {
// Send discover request
var discoveryRequest = Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api_version',
onComplete: function(response) {
// Check response json data
Expand Down Expand Up @@ -90,7 +90,7 @@ var freebox = {
});
// Send authorize request
var authorizeRequest = Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/login/authorize/',
content: content,
onComplete: function(response) {
Expand Down Expand Up @@ -122,7 +122,7 @@ var freebox = {
authorizeTrack: function(track_id, callback) {
// Send track authorization status
var authorizeRequest = Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/login/authorize/' + track_id,
onComplete: function(response) {
// Check response json data
Expand Down Expand Up @@ -156,7 +156,7 @@ var freebox = {
login: function(callback) {
// Send login request
Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/login/',
onComplete: function(response) {
// Check response json data
Expand All @@ -180,7 +180,7 @@ var freebox = {
});
// Send login request
Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/login/session/',
content: content,
onComplete: function(response) {
Expand Down Expand Up @@ -222,7 +222,7 @@ var freebox = {
return false;
// Create and send download add request
Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/downloads/add',
headers: {
'X-Fbx-App-Auth': session_token
Expand Down Expand Up @@ -263,7 +263,7 @@ var freebox = {
return false;
// Create and send download list request
Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/downloads/',
headers: {
'X-Fbx-App-Auth': session_token
Expand Down Expand Up @@ -299,7 +299,7 @@ var freebox = {
return false;
// Create and send fs ls request
Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/fs/ls/' + path,
headers: {
'X-Fbx-App-Auth': session_token
Expand Down Expand Up @@ -338,7 +338,7 @@ var freebox = {
});
// Create and send mkdir request
Request({
anon: true,
anonymous: true,
url: 'http://mafreebox.freebox.fr/api/v3/fs/mkdir/',
headers: {
'X-Fbx-App-Auth': session_token
Expand Down

0 comments on commit 7aa0938

Please sign in to comment.