Skip to content

Commit

Permalink
make AppleCaptivePortalHandle able to change options after initialzia…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
greggman committed Nov 22, 2014
1 parent 9981790 commit f3c349b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions server/apple-captive-portal-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,29 @@ var url = require('url');
*
* @constructor
* @private
* @param {AppleCaptivePortalHandler~Options} sendFileFn
* @param {AppleCaptivePortalHandler~Options} options options
*/
var AppleCaptivePortalHandler = function(options) {
// This is a total guess. I'm assuming iOS sends a unique URL. I can use that to hopefully
// return my redirection page the first time and apple's success page the second time
this.sessions = {};
this.options = options;
this.options = {};
this.firstPath = "/enter-name.html";
this.setOptions(options);
};

/**
* Sets options
*
* @param {AppleCaptivePortalHandler~Options} options options
*/
AppleCaptivePortalHandler.prototype.setOptions = function(options) {
["sendFileFn", "address", "port", "baseDir"].forEach(function(key) {
var value = options[key];
if (value !== undefined) {
this.options[key] = value;
}
}.bind(this));
};

/**
Expand Down

0 comments on commit f3c349b

Please sign in to comment.