Skip to content

Error: Forbidden send.js #38

Closed
huei90 opened this Issue Mar 11, 2014 · 13 comments
@huei90
huei90 commented Mar 11, 2014

Heading this problem on current version.

expressjs/express#1229

@Hiswe
Hiswe commented Mar 26, 2014

Experiencing the same issue with v1.0.10

@radare
radare commented Mar 26, 2014

Backtraces shouldn't be dumped to the socket. It leaks paths

@artyomtrityak

have same issue

@AveVlad AveVlad closed this Apr 1, 2014
@shuhei
shuhei commented Jun 17, 2014

Hi, I'm still getting this error with 2.0.5. Was it closed because it's gonna be fixed on the next release?

@shuhei
shuhei commented Jun 17, 2014

Ah, sorry. That was because I set { root: '.' }.

@connor11528

what is the best practice then to set the root as .?

I have

connect.server({
    root: '.',
    livereload: true
})

What's it supposed to be?

@kosz
kosz commented Dec 4, 2014

any resolution here yet ?

@doomsbuster

I am facing similar issue. Here is my connect configuration:

gulp.task('connect', function() {
    connect.server({
        root: '.',
        livereload: 'true',
        middleware: function(connect, o) {
            return [
                (function() {
                    var url = require('url');
                    var proxy = require('proxy-middleware');
                    var options = url.parse('http://localhost:8181/api');
                    options.route = "/api";
                    return proxy(options);
                })()
            ]
        }
    });
});

and i get error

Error: Forbidden
    at createError (/home/ironman/coding/GIT/addash/src/main/webapp/node_modules/gulp-connect/node_modules/connect/node_modules/serve-index/index.js:188:13)
    at Object.directory [as handle] (/home/ironman/coding/GIT/addash/src/main/webapp/node_modules/gulp-connect/node_modules/connect/node_modules/serve-index/index.js:100:46)
    at next (/home/ironman/coding/GIT/addash/src/main/webapp/node_modules/gulp-connect/node_modules/connect/lib/proto.js:194:15)
    at SendStream.error (/home/ironman/coding/GIT/addash/src/main/webapp/node_modules/gulp-connect/node_modules/connect/node_modules/serve-static/index.js:86:37)
    at SendStream.emit (events.js:95:17)
    at SendStream.error (/home/ironman/coding/GIT/addash/src/main/webapp/node_modules/gulp-connect/node_modules/connect/node_modules/serve-static/node_modules/send/lib/send.js:172:51)
    at SendStream.onStatError (/home/ironman/coding/GIT/addash/src/main/webapp/node_modules/gulp-connect/node_modules/connect/node_modules/serve-static/node_modules/send/lib/send.js:285:48)
    at /home/ironman/coding/GIT/addash/src/main/webapp/node_modules/gulp-connect/node_modules/connect/node_modules/serve-static/node_modules/send/lib/send.js:378:26
    at Object.oncomplete (fs.js:107:15)
@doomsbuster

I think i figured this out, if you are running gulp from your project, you do not need to supply root in the connect task. Following fixed the issue for me.

gulp.task('connect', function() {
    connect.server({
        livereload: 'true',
        middleware: function(connect, o) {
            return [
                (function() {
                    var url = require('url');
                    var proxy = require('proxy-middleware');
                    var options = url.parse('http://localhost:8181/api');
                    options.route = "/api";
                    return proxy(options);
                })()
            ]
        }
    });
});
@yuchuanxi

@doomsbuster I fixed the issue as you. thank you very much!

@kunegun
kunegun commented Feb 10, 2015

@doomsbuster It works for me too! thx

@ciscoo
ciscoo commented Feb 10, 2015

@doomsbuster also worked for me, thanks!

@wikieswan

@doomsbuster thx,it helps me!~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.