Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.4.0 Beta2
-
None
-
-
37dde10311 (qt/qthttpserver/dev) 5e7aabced8 (qt/qthttpserver/6.4) 5e7aabced8 (qt/qthttpserver/6.4.1)
-
Foundation Sprint 65
Description
A handler for a route can either return a value from the function which will be used as a response, e.g.
[](...) { return "Hello"; }
Or it can accept the special QHttpServerResponder object as a parameter.
[](QHttpServerResponder &&responder) { responder.write("hello"); }
When someone does both, having the QHttpServerResponder argument, as well as trying to return a string, then the return doesn't do anything.
In fact it should probably be an error to return anything other than void in this case.
[](**QHttpServerResponder &&responder**) { **return** "Hello"; // It would be good if this was a compile time error. }
Attachments
For Gerrit Dashboard: QTBUG-105329 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
430938,4 | QHttpServer: Route handlers with responders should not return a value | dev | qt/qthttpserver | Status: MERGED | +2 | 0 |
431121,2 | QHttpServer: Route handlers with responders should not return a value | 6.4 | qt/qthttpserver | Status: MERGED | +2 | 0 |