* Overrides onRequest. * * @param req * * @private
(req)
| 49 | * @private |
| 50 | */ |
| 51 | onRequest(req) { |
| 52 | const res = req.res; |
| 53 | // remove the reference to the ServerResponse object (as the first request of the session is kept in memory by default) |
| 54 | req.res = null; |
| 55 | |
| 56 | if (req.getMethod() === "get") { |
| 57 | this.onPollRequest(req, res); |
| 58 | } else if (req.getMethod() === "post") { |
| 59 | this.onDataRequest(req, res); |
| 60 | } else { |
| 61 | res.writeStatus("500 Internal Server Error"); |
| 62 | res.end(); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * The client sends a request awaiting for us to send data. |
nothing calls this directly
no test coverage detected