Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket.io.js served using http2 cannot load sourcemap due to possible routing error #2762

Closed
1 of 2 tasks
SeinopSys opened this issue Nov 24, 2016 · 3 comments
Closed
1 of 2 tasks

Comments

@SeinopSys
Copy link

You want to:

  • report a bug
  • request a feature

Current behavior & steps to reproduce

Navigating to https://ws.example.com:8667/socket.io/socket.io.js.map opens the exact same file as https://ws.example.com:8667/socket.io/socket.io.js.

Expected behavior

According to the //# sourceMappingURL=socket.io.js.map comment at the end of the file a source map should be loaded from the URL instead of the script itself.

Setup

  • OS: Debian Jessie 8.6
  • browser: Chrome 54.0.2840.99
  • socket.io version: 1.6.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)

Most likely an issue with a match check that returns when it finds the name of the js file and ignores the .map at the end. I'm adding my server setup code as well in case it matters:

var Server = require('socket.io'),
    express = require('express'),
    app = express(),
    https = require('http2'),
    cors = require('cors');

// CORS
app.use(cors(function(req, callback){
    var corsOptions = { origin: false };
    if (/^https:\/\/example\.com/.test(req.header('Origin')))
        corsOptions.origin = true;
    callback(null, corsOptions);
}));

app.get('/', function (req, res) {
    res.sendStatus(403);
});

var lex = require('letsencrypt-express').create({
    server: 'https://acme-v01.api.letsencrypt.org/directory',
    email: 'user@example.com',
    agreeTos: true,
    approveDomains: [ 'ws.example.com'],
});
var server = https.createServer(lex.httpsOptions, lex.middleware(app));
server.listen(PORT);
var io = Server.listen(server);
@darrachequesne
Copy link
Member

Hi! The sourcemap is not currently served (as of 1.6.0), but will be in the next release: #2482.

@SeinopSys
Copy link
Author

Will the JS file be served minified, or will it be kept the same way as it is now?

@darrachequesne
Copy link
Member

I guess we can serve the minified file, too. Let's do this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants