I vacillated on that and just decided to have them both in, but I agree
that it's probably safe to not duplicate it.  I wanted it in StaticServer
to clean up any invalid pref values which was necessary for detecting port
changes.  I would get rid of it on the StaticServerDomain side since
currently there is nothing else calling it.


On Thu, Feb 13, 2014 at 3:16 PM, Kevin Dangoor <notifications@github.com>wrote:

> In src/extensions/default/StaticServer/node/StaticServerDomain.js:
>
> > @@ -98,7 +98,20 @@
> >      function normalizeRootPath(path) {
> >          return (path && path[path.length - 1] === "/") ? path.slice(0, -1) : path;
> >      }
> > -
> > +
> > +    /**
> > +     * @private
> > +     * Converts given value to a valid port number or zero.
> > +     * A zero will cause a random port to be used.
> > +     * @param {number} port number to clean, can be string as well
> > +     * @return {number} a valid port number or zero if a value wasn't passed in or valid.
> > +     */
> > +    function sanitizePort(port) {
>
> It seems like it's probably safe to just do this on one side of the
> connection. You're now doing this on the client side. Or is there a code
> path I haven't noticed yet that could still pass an unsanitized port across?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/adobe/brackets/pull/6815/files#r9727721>
> .
>