mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-13 17:07:54 -05:00
Compare commits
7 Commits
socket.io-
...
2.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6b869738c | ||
|
|
a169050947 | ||
|
|
873fdc55ed | ||
|
|
f78a575f66 | ||
|
|
d33a619905 | ||
|
|
3951a79359 | ||
|
|
6fa026fc94 |
24
.github/workflows/ci.yml
vendored
Normal file
24
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-node:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [10.x, 12.x, 14.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm test
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
12
.travis.yml
12
.travis.yml
@@ -1,12 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
sudo: false
|
|
||||||
node_js:
|
|
||||||
- '8'
|
|
||||||
- '10'
|
|
||||||
notifications:
|
|
||||||
irc: "irc.freenode.org#socket.io"
|
|
||||||
git:
|
|
||||||
depth: 1
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- node_modules
|
|
||||||
15
CHANGELOG.md
Normal file
15
CHANGELOG.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
## [2.4.1](https://github.com/socketio/socket.io/compare/2.4.0...2.4.1) (2021-01-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* fix(security): do not allow all origins by default ([a169050](https://github.com/socketio/socket.io/commit/a1690509470e9dd5559cec4e60908ca6c23e9ba0))
|
||||||
|
|
||||||
|
|
||||||
|
# [2.4.0](https://github.com/socketio/socket.io/compare/2.3.0...2.4.0) (2021-01-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **security:** do not allow all origins by default ([f78a575](https://github.com/socketio/socket.io/commit/f78a575f66ab693c3ea96ea88429ddb1a44c86c7))
|
||||||
|
* properly overwrite the query sent in the handshake ([d33a619](https://github.com/socketio/socket.io/commit/d33a619905a4905c153d4fec337c74da5b533a9e))
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# socket.io
|
# socket.io
|
||||||
|
|
||||||
[](#backers) [](#sponsors)
|
[](#backers) [](#sponsors)
|
||||||
[](https://travis-ci.org/socketio/socket.io)
|
[](https://github.com/socketio/socket.io/actions)
|
||||||
[](https://david-dm.org/socketio/socket.io)
|
[](https://david-dm.org/socketio/socket.io)
|
||||||
[](https://david-dm.org/socketio/socket.io#info=devDependencies)
|
[](https://david-dm.org/socketio/socket.io#info=devDependencies)
|
||||||
[](https://www.npmjs.com/package/socket.io)
|
[](https://www.npmjs.com/package/socket.io)
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ Socket.prototype.buildHandshake = function(query){
|
|||||||
function buildQuery(){
|
function buildQuery(){
|
||||||
var requestQuery = url.parse(self.request.url, true).query;
|
var requestQuery = url.parse(self.request.url, true).query;
|
||||||
//if socket-specific query exist, replace query strings in requestQuery
|
//if socket-specific query exist, replace query strings in requestQuery
|
||||||
return Object.assign({}, query, requestQuery);
|
return Object.assign({}, requestQuery, query);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
headers: this.request.headers,
|
headers: this.request.headers,
|
||||||
|
|||||||
3352
package-lock.json
generated
Normal file
3352
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "socket.io",
|
"name": "socket.io",
|
||||||
"version": "2.3.0",
|
"version": "2.4.1",
|
||||||
"description": "node.js realtime framework server",
|
"description": "node.js realtime framework server",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"realtime",
|
"realtime",
|
||||||
@@ -25,10 +25,10 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "~4.1.0",
|
"debug": "~4.1.0",
|
||||||
"engine.io": "~3.4.0",
|
"engine.io": "~3.5.0",
|
||||||
"has-binary2": "~1.0.2",
|
"has-binary2": "~1.0.2",
|
||||||
"socket.io-adapter": "~1.1.0",
|
"socket.io-adapter": "~1.1.0",
|
||||||
"socket.io-client": "2.3.0",
|
"socket.io-client": "2.4.0",
|
||||||
"socket.io-parser": "~3.4.0"
|
"socket.io-parser": "~3.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1621,8 +1621,25 @@ describe('socket.io', function(){
|
|||||||
expect(s.handshake.query.key2).to.be('&=bb');
|
expect(s.handshake.query.key2).to.be('&=bb');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should see the query options sent in the Socket.IO handshake (specific to the given socket)', (done) => {
|
||||||
|
const srv = http();
|
||||||
|
const sio = io(srv);
|
||||||
|
const socket = client(srv, '/namespace',{ query: { key1: 'a', key2: 'b' }}); // manager-specific query option
|
||||||
|
socket.query = { key2: 'c' }; // socket-specific query option
|
||||||
|
|
||||||
|
const success = () => {
|
||||||
|
sio.close();
|
||||||
|
socket.close();
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
|
||||||
|
sio.of('/namespace').on('connection', (s) => {
|
||||||
|
expect(s.handshake.query.key1).to.be('a'); // in the query params
|
||||||
|
expect(s.handshake.query.key2).to.be('c'); // in the Socket.IO handshake
|
||||||
|
success();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle very large json', function(done){
|
it('should handle very large json', function(done){
|
||||||
|
|||||||
Reference in New Issue
Block a user