Gamah Gamerson 42cee6807d Http.RequestStreamAsync: stream the response instead of buffering it
RequestStreamAsync went through RequestAsync, which sends with the
default HttpCompletionOption.ResponseContentRead - so the whole body was
downloaded before the task resolved, and the "stream" handed back was
the buffer. A response that never ends (NDJSON, SSE, a chunked long
poll) therefore never resolved at all.

It also did `using var response`, disposing the response and with it the
content stream, before returning that stream to the caller. That second
bug hid the first: you could not read the stream far enough to notice
the buffering.

Send with ResponseHeadersRead and return a stream that owns the
HttpResponseMessage and disposes it with itself. RequestAsync's
signature is untouched, so no Sandbox.Access change is needed, and the
consumer side (System.IO.Stream.*, StreamReader) was already
whitelisted. Validation is unaffected: SboxHttpHandler runs
Http.IsAllowedAsync before every send, redirects included, all before
the headers come back.

WebTests.HttpStreamTest serves paced chunked NDJSON on localhost:8080 (a
port Http.IsAllowed accepts) and asserts the call returns before the
body ends, that the lines arrive spread across it rather than at once,
and that a non-2xx still throws.
2026-07-30 17:55:19 +01:00
2026-01-12 21:59:15 +01:00
2025-11-24 09:05:18 +00:00
2025-11-24 09:05:18 +00:00
2026-01-26 13:31:46 +00:00

s&box

s&box is a modern game engine, built on Valve's Source 2 and the latest .NET technology, it provides a modern intuitive editor for creating games.

s&box editor

If your goal is to create games using s&box, please start with the getting started guide. This repository is for building the engine from source for those who want to contribute to the development of the engine.

Getting the Engine

Steam

You can download and install the s&box editor directly from Steam.

Compiling from Source

If you want to build from source, this repository includes all the necessary files to compile the engine yourself.

Prerequisites

Building

# Clone the repo
git clone https://github.com/Facepunch/sbox-public.git

Once you've cloned the repo simply run Bootstrap.bat which will download dependencies and build the engine.

The game and editor can be run from the binaries in the game folder.

Contributing

If you would like to contribute to the engine, please see the contributing guide.

If you want to report bugs or request new features, see sbox-issues.

Documentation

Full documentation, tutorials, and API references are available at sbox.game/dev/.

License

The s&box engine source code is licensed under the MIT License.

Certain native binaries in game/bin are not covered by the MIT license. These binaries are distributed under the s&box EULA. You must agree to the terms of the EULA to use them.

This project includes third-party components that are separately licensed. Those components are not covered by the MIT license above and remain subject to their original licenses as indicated in game/thirdpartylegalnotices.

Description
No description provided
Readme 1.2 GiB
Languages
C# 91.9%
HLSL 3.7%
HTML 1.8%
C++ 1.3%
SCSS 1.1%
Other 0.1%