From 0188fe9be86f09ad4589c84400be513e19f71aa5 Mon Sep 17 00:00:00 2001 From: Furior Date: Sat, 4 Jan 2025 16:42:30 +0700 Subject: [PATCH] status code bandaid --- modular_bandastation/tts/code/SSHttp.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modular_bandastation/tts/code/SSHttp.dm b/modular_bandastation/tts/code/SSHttp.dm index f42b5c800a7c2..52d7d298dd727 100644 --- a/modular_bandastation/tts/code/SSHttp.dm +++ b/modular_bandastation/tts/code/SSHttp.dm @@ -80,6 +80,15 @@ SUBSYSTEM_DEF(http) /// Callback for executing after async requests. Will be called with an argument of [/datum/http_response] as first argument var/datum/callback/cb +/datum/http_request/into_response() + . = ..() + + // HACK: I have no idea why this is necessary, but it is. + var/static/reg = ": status code ([0-9]{3})" + var/matched = findtext(_raw_response, reg) + if (matched) + R.status_code = text2num(copytext(matched, 15)) + /world/Del() rustgss220_close_async_http_client() . = ..()