Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upadd cache-control header to client source #2907
Merged
Conversation
b00ae50
into
socketio:develop
1 check passed
1 check passed
|
Finally! Thanks |
Xdust
added a commit
to Xdust/socket.io
that referenced
this pull request
May 2, 2019
* Add hasOwnProperty checks * namespace: clear rooms flag after a clients call (fixes socketio#1978) * package: bump parser * Trigger callback even when joining an already joined room * package: bump `engine.io` for release * socket.io: increase large binary data test timeout * package: bump `engine.io` * package: bump `engine.io` for `ws` memory fix * package: temporarily revert version for tests * package: bump `engine.io` for node 0.8 fix * package: bump `socket.io-adapter` for release * package: bump `engine.io` * improve the chat demo * fix wrong jsdoc * fix typo word :) update docs source code * package: bump `engine.io` for sec advisory * Release 1.4.0 * Release 1.4.1 * Add badges showing dependency status * Bump dev dependencies * package: bump `engine.io` * Release 1.4.2 * Release 1.4.3 * Document type change of Socket#rooms * package: bump `engine.io` * Release 1.4.4 * add a test for graceful shutdown * package: bump `engine.io` * Release 1.4.5 * fix to issue socketio#331 on socket.o-client. Parses CONNECT packet for query string and replaces query in socket.handshake. * refactor parsing of URL in CONNECT packet to use 'url' library. * Issue socketio#2400, added documentation * updated express version to express 4 * test node 5 (stable) * add test for issue socketio#331 on socket.io-client. * add comments to code * call decodeURIComponent on query received from client. update package.son to point to latest commit in socket.o-client package (with URI encoder) * change decodeUriComponents calls * conform to style guide * remove unnecessary decoder. `url.parse` already decodes string. add test to test decoding function. * update tests. * implement gulp build system for test. * delete unused dependency * integrated babel into gulp * added comment for babel * added test-cov task. * npm test script to use gulp * Inline babel configuration * Don't use dynamic dependencies * Add gulp help Work was done by @YijinL in 2 separate commits (@9204125 and @05ad308) * Minor refactoring to transpile task - Transpiling is now gulp transpile - Default redirects to transpile - Refactor transpile output directory to a separate constant - Work by @YijinL in @05ad308 * Add gulp task clean to clean transpile output - Work done by @YijinL. Part of @05ad308 * Use local instead of global gulp in npm test * Minor fixes to gulp tasks - Only provide entry point as first argument of gulp.src - {read:false} option for mocha tests - change timeout:2000 to slow:200 to mirror makefile's mocha options - replace var with const where appropriate * Redirect make tasks to gulp * Remove node 0.8 from travis * Fix chat display in Firefox * Update repository URL * Explicit local gulp is unnecesary * add compat test for babel-transformed codes * implement compat test using env variable * added compat test * use multiple npm scripts * set env vars in travis * explicit distinction between current and compat in test so we can serve either compat or current as default * babel transpile before test, print error * changed env var name, added testing documentation to readme * disable loading lib by default to avoid syntax error due to lib containing new es6 syntax * styling fixes * stop append /# before id when no namespace * ignore dist for now * fixed version notation * add quote to exec paths, prevent error when spaces in path * use a bigger timeout for slower machine * package: bump engine.io * Release 1.4.6 * package: bump `engine.io` * Release 1.4.7 * package: bump `engine.io` * Release 1.4.8 * Prevent mixup for new programmers The documentation, inadvertently, causes confusion for newer programmers, hindering their learning curve and ability to learn `socket.io` faster. This proposed change aims at preventing this confusion to allow new programmers easier access to resources, especially when searching the web for more information. The name `socket` in the documentation refers to the API gateway, or abstraction layer, related to the `client` and other properties. However, in the rest of the programming world, `sockets` usually refer to Berklee sockets or the lower-level communication channel that is used to implement Protocols such as the Websocket Protocol and HTTP. New programmers often search for more informations using the `sockets` keyword when they are grappling with learning the `socket.io` API. A good example is the stack overflow site, where newer programmers incorrectly tag their questions `sockets` and in turn don't get a fast response to their questions. By simply changing the name of the variable used to describe socket.io's "Socket" class instances from `socket` to `client`, this mixup should be mitigated considerably. * [chore] Bump engine.io to 1.7.0 (socketio#2707) * [chore] Remove unused zuul-ngrok dependency (socketio#2708) * [chore] Point towards current master of socket.io-client (socketio#2710) * [chore] Restrict files included in npm package (socketio#2709) * [chore] Link build badge to master branch (socketio#2549) * [feature] Add a 'disconnecting' event to access to socket.rooms upon disconnection (socketio#2332) * [chore] release 1.5.0 (socketio#2711) * [docs] Add link to LICENSE (socketio#2221) * [docs] Fix JSDoc of optional parameters (socketio#2465) Making proper optional Docs for socketIO * [docs] Fix typo (socketio#2724) * [docs] Link readme npm package badge to npm registry page (socketio#2612) * [fix] Avoid swallowing exceptions thrown by user event handlers (socketio#2682) * [chore] Bump socket.io-parser to 2.3.0 (socketio#2730) * [docs] Minor fixes (socketio#2526) * [chore] Add Github issue and PR templates (socketio#2733) * [test] Use client function to unify `client` in test script (socketio#2731) * [chore] Bump engine.io to 1.7.2 (socketio#2729) * [chore] Bump socket.io-parser to 2.3.1 (socketio#2734) * [chore] Release 1.5.1 (socketio#2735) * [fix] Make ETag header comply with standard. (socketio#2603) The standard says that an ETag must be surrounded in double quotes: https://tools.ietf.org/html/rfc7232#section-2.3 Although browsers tend to be lenient, omitting the quotes can confuse/break some kinds of proxies and other tools that demand compliant formatting. For example, Sandstorm.io enforces strict HTTP usage for security reasons and will block responses with invalid ETags. * [feature] Loading client script on demand. (socketio#2567) Support for the serving of the client script mess with packagers like browserify, webpack. Especcialy in projects where it is not used at all. This patch is workaround to avoid that problem in the cases when client script is not served. * [test] Fix leaking clientSocket (socketio#2721) Test 'should be able to close sio sending a port' defined a clientSocket but didn't set 'reconnection: false'. Now, the default behavior of a clientSocket is 'reconnection: true'. As a result, the clientSocket was "leaked" from the test case and seemed to intermittently connect to the servers in subsequent test cases. This would cause other tests to timeout unexpectedly. It's not clear to me why this would happen, since the test case assigns a unique port number to the socket. However, if you go into socket.io-client and assign and log unique IDs to each socket, then you'll see that this clientSocket shows up in other test cases if the reconnectionDelay strikes unluckily. * [feature] Add support for all event emitter methods (socketio#2601) * [chore] Update year to 2016 (socketio#2456) * [feature] Add support for socket middleware (socketio#2306) * [feature] add support for Server#close(callback) (socketio#2748) * [fix] Don't drop query variables on handshake (socketio#2745) Parameters passed during handshake, such as tokens, were being dropped. * [example] Add disconnection/reconnection logs to the chat example (socketio#2675) * [perf] Minor code optimizations (socketio#2219) * [chore] Bump debug to version 2.3.3 (socketio#2754) * [chore] Bump engine.io to version 1.8.0 (socketio#2755) * [chore] Bump socket.io-adapter to version 0.5.0 (socketio#2756) * [chore] Release 1.6.0 (socketio#2757) * [docs] Comment connected socket availability for adapters (socketio#2081) * [docs] Fixed grammar issues in the README.md (socketio#2159) Added a few periods and commas which were missing. Pluralised the word 'parameter' where it was incorrectly specified to singular on line 281. Very minor edit. No source code changed. * [feature] serve sourcemap for socket.io-client (socketio#2482) * [feature] Add a `local` flag (socketio#2628) That new flag will prevent the adapter (redis) from publishing the emit to the pub/sub server. When several instances of a server receive the same event from a third party (not from a client), each server instance broadcasts the event to all his clients. With the local flag, and the change in the redis adapter, each server instance send the event only to his client, so each client receive only one unique event. * [chore] Bump engine.io to version 1.8.1 (socketio#2765) * [chore] Update client location and serve minified file (socketio#2766) Following socketio/socket.io-client#1025, the output files are now generated in the dist directory. * [chore] Release 1.7.0 (socketio#2767) * [chore] Release 1.7.1 (socketio#2768) * [fix] Fixes socket.use error packet (socketio#2772) * fix(socket): Fixes socket.use error packet which drops nodejs due to nuances of Nodejs' EventEmitter * fix(socket): Fixes missing error event on socket * fix(socket): test fix, should listen for clientSocket instead of server socket * minor update * [chore] Bump engine.io to version 1.8.2 (socketio#2782) * [chore] Release 1.7.2 (socketio#2783) * [docs] API documentation (socketio#2784) * [docs] Add install script on Readme.md (socketio#2780) * [perf] micro-optimisations (socketio#2793) * [fix] Prevent null from being accepted as argument (socketio#2606) * [docs] Fix wrong argument name in API.md (socketio#2802) * [chore] Update copyright year LICENSE to 2017 (socketio#2803) * [chore] Update issue template with fiddle (socketio#2811) * [docs] Fix a typo on `clients` method in the API documentation (socketio#2812) * [docs] Add an example for socket.join() method (socketio#2813) * [docs] Add pingInterval/pingTimeout/transports options in the API documentation (socketio#2814) * [docs] Add emit cheatsheet (socketio#2815) * [docs] Fix documentation for `local` flag (socketio#2816) * [perf] Reset properties instead of deleting them (socketio#2826) Deleting properties is a v8 'optimization killer' * [perf] Use shared instance of the encoder (socketio#2825) * [fix] Properly close the connection on error (socketio#2681) * [docs] Implement whiteboard example (socketio#2810) * [docs] Add nginx cluster example (socketio#2817) * [docs] Add haproxy cluster example (socketio#2818) * [docs] Add httpd cluster example (socketio#2819) * [docs] Add a 'Features' section in the README (socketio#2824) * [fix] Use path.resolve by default and require.resolve as a fallback (socketio#2797) Browserify doesn't support require.resolve, and as a consequence, makes nexe fail the compilation. This PR attempts to get the path of the socket.io-client file via path.resolve and falls back to the original require.resolve if this file cannot be found. * [chore] Bump engine.io to version 2.0.0 (socketio#2832) * [feature] Allow the use of custom parsers (socketio#2829) * [docs] Small addition to the Express Readme Part (socketio#2846) * [feature] Merge Engine.IO and Socket.IO handshake packets (socketio#2833) * [docs] Update the wording to match the code example (socketio#2853) * [chore] Bump engine.io to version 2.0.2 (socketio#2864) Includes the following (from engine.io changelog): * [fix] Initialize the WebSocket server in the Server constructor (socketio#476) * [chore] Bump ws to version 1.1.2 (vulnerability fix) (socketio#480) * [chore] Bump socket.io-adapter to version 1.0.0 (socketio#2867) * [docs] Add webpack build example (socketio#2828) * [feat] Allow to join several rooms at once (socketio#2879) * [docs] Fix documentation for 'connect' event (socketio#2898) * [docs] Fix wrong space character in README (socketio#2900) * [docs] Add server.engine.generateId attribute (socketio#2880) * [docs] Explicitly document that Server extends EventEmitter (socketio#2874) * [docs] Update emit cheatsheet (socketio#2906) * [docs] Replace non-breaking space with proper whitespace (socketio#2913) * [feat] Move binary detection to the parser (socketio#2923) * [chore] Bump dependencies (socketio#2926) * [chore] Added backers and sponsors on the README (socketio#2933) * [chore] Merge history of 1.7.x and 0.9.x branches (socketio#2930) * [docs] Add an example of custom parser (socketio#2929) * [chore] Release 2.0.0 * [fix] Update path of client file (socketio#2934) * [chore] Release 2.0.1 * [fix] Fix timing issues with middleware (socketio#2948) Using a middleware could previously lead to a connecting client receiving a connect event from the server before the server triggers its own connect event. * [chore] Release 2.0.2 * [docs] Update webpack example (socketio#2960) * [docs] Update slack badge (socketio#2961) Update badge to https://slackin-socketio.now.sh/badge.svg * [fix] Fix middleware initialization (socketio#2969) Fix "TypeError: Cannot convert undefined or null to object" when a middleware is added before the engine is properly attached. * [fix] Reset rooms object before broadcasting (socketio#2970) It seems packets could be delivered to wrong room in some case, if the _rooms array was not reset before the next emit. * [chore] Release 2.0.3 * [docs] Update API documentation (socketio#2973) * [docs] Update Webpack server example (socketio#2976) * [docs] Fix misnamed 'Object.keys' in API docs (socketio#2979) * [docs] Add io.emit in the cheat sheet (socketio#2992) * [fix] Do not throw when receiving an unhandled error packet (socketio#3038) * [fix] Reset rooms object before broadcasting from namespace (socketio#3039) * [docs] Use path.join instead of concatenating paths (socketio#3014) * [docs] Actually prevent input from having injected markup in chat example (socketio#2987) * [docs] Fix typo in API docs (socketio#3066) * [docs] Fix a grammar mistake in the API docs (socketio#3076) * [test] Use npm scripts instead of gulp (socketio#3078) * [chore] Release 2.0.4 * [chore] Bump debug to version 3.1.0 * [docs] Fix typo (socketio#3157) * [test] Update travis configuration * [feat] Add a 'binary' flag (socketio#3185) So that the call to the `has-binary` method can be skipped. Usage: ``` // with binary data socket.binary(true).emit("binary", obj); // without binary data socket.binary(false).emit("string", obj); // call to hasBin socket.emit("guess", obj); ``` * [docs] Update license year (socketio#3153) * [chore] Bump engine.io to version 3.2.0 * [chore] Bump superagent and supertest versions (socketio#3186) * [feat] Add support for dynamic namespaces (socketio#3187) * [docs] Add link to a Dart client implementation (socketio#2940) * [fix] Properly emit 'connect' when using a custom namespace (socketio#3197) When using a custom namespace with a middleware, the client did not receive the 'connect' event. Fixes socketio#3082 * [fix] Include the protocol in the origins check (socketio#3198) Previously, the protocol was not taken in account, which caused the following behaviour: ```js io.origins('https://foo.example.com:443'); // ok as a string io.origins(['https://foo.example.com:443'); // not ok as an array ``` Fixes socketio#3190 * [docs] Add note in docs for `origins(fn)` about `error` needing to be a string. (socketio#2895) * [feat] Add support for dynamic namespaces (socketio#3195) This follows socketio#3187, with a slightly different API. A dynamic namespace can be created with: ```js io.of(/^\/dynamic-\d+$/).on('connect', (socket) => { /* ... */ }); ``` * [chore] Release 2.1.0 * [docs] Clarify private messaging in the emit cheatsheet (socketio#3232) The previous version was confusing, as `socket.to(socket.id).emit()` does nothing. Fixes socketio#3220 * [docs] Convert the chat example to ES6 (socketio#3227) * [feat] Add local flag to the socket object (socketio#3219) To match the behaviour on the namespace (see socketio#2628). * [chore] Release 2.1.1 * [docs] update README.md (socketio#3309) * [chore] Update issue template * [docs] fix `this` scope in the chat example `user is typing` messages were not properly removed Closes socketio#3291 * [docs] Use new JavaScript syntax inside the README (socketio#3360) * [test] Update Travis configuration Reference: https://github.com/nodejs/Release * [chore] Bump dependencies - engine.io: socketio/engine.io@3.2.0...3.3.1 - socket.io-parser: https://github.com/socketio/socket.io-parser/compare/3.2.0..3.3.0 * [fix] Throw an error when trying to access the clients of a dynamic namespace (socketio#3355) Accessing the clients of a dynamic namespace throws because doing `io.of(/your-regex/g)` returns a namespace with no adapter and the clients methods tries to access `namespace.adapter.clients`. * [docs] Add Touch Support to the whiteboard example (socketio#3104) * [feat] Add cache-control header when serving the client source (socketio#2907) * [chore] Release 2.2.0 * [chore] Update the license of the chat example (socketio#3410) There was no obvious reason to use BSD instead of MIT for that very basic chat app. Closes socketio#3411
This was referenced Jun 5, 2019
This was referenced Jan 23, 2020
This was referenced Mar 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.


maxlego commentedApr 1, 2017
The kind of change this PR does introduce
Current behaviour
No cache-control header is sent when requesting clien script
New behaviour
Server will send cache-control header with value "public, max-age=0"
Other information (e.g. related issues)