Merge branch 'maintenance' into devel

This commit is contained in:
GitHub Nightly Merge Action committed 2023-01-17 00:12:48 +00:00
commit 0ed259e1a8
5 files changed
+39 -1

No files matched your search

+1
View File
@@ -174,6 +174,7 @@ date of first contribution):
* [Arkadiusz Miśkiewicz](https://github.com/arekm)
* ["tempodat"](https://github.com/tempodat)
* [Frederik Kemner](https://github.com/040medien)
* [Moiz Rasheed](https://github.com/msrasheed)
* [Scott Martin](https://github.com/smartin015)
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
+17
View File
@@ -60,6 +60,23 @@
:param string message: The type of message for which to register
:param function handler: The handler function
.. js:function:: OctoPrintClient.socker.removeMessage(message, handler)
Removes the ``handler`` for messages of type ``message``.
.. code-block:: javascript
const handler = (message) => {
// do something with the message object
};
OctoPrint.socket.onMessage("*", handler);
// Use the same reference to the handler function to remove it again
OctoPrint.socket.removeMessage("*", handler);
:param string message: The type of message for which to remove the handler
:param function handler: The handler function
.. js:function:: OctoPrintClient.socket.sendMessage(type, payload)
Sends a message of type ``type`` with the provided ``payload`` to the server.
+8
View File
@@ -795,6 +795,14 @@ class WsgiInputContainer:
environ["CONTENT_TYPE"] = request.headers.pop("Content-Type")
if "Content-Length" in request.headers:
environ["CONTENT_LENGTH"] = request.headers.pop("Content-Length")
# remove transfer encoding header if chunked, otherwise flask wsgi entrypoint makes input empty
if (
"Transfer-Encoding" in request.headers
and request.headers.get("Transfer-Encoding") == "chunked"
):
request.headers.pop("Transfer-Encoding")
for key, value in request.headers.items():
environ["HTTP_" + key.replace("-", "_").upper()] = value
return environ
@@ -220,6 +220,18 @@
return this;
};
OctoPrintSocketClient.prototype.removeMessage = function (message, handler) {
if (!this.registeredHandlers.hasOwnProperty(message)) {
// No handlers registered, do nothing
return;
}
const index = OctoPrint.socket.registeredHandlers[message].indexOf(handler);
if (index > -1) {
OctoPrint.socket.registeredHandlers[message].splice(index, 1);
}
};
OctoPrintSocketClient.prototype.onReconnectAttempt = function (trial) {};
OctoPrintSocketClient.prototype.onReconnectFailed = function () {};
OctoPrintSocketClient.prototype.onConnected = function () {};
+1 -1
View File
@@ -6110,7 +6110,7 @@ class SendQueue(PrependableQueue):
_temp_command_regex = re.compile(
r"^M(?P<command>104|109|140|190)(\s+T(?P<tool>\d+)|\s+S(?P<temperature>[-+]?\d*\.?\d*))+"
r"^M(?P<command>104|109|140|190)(\s+T(?P<tool>\d+)|\s+[SR](?P<temperature>[-+]?\d*\.?\d*))+"
)