Age | Commit message (Collapse) | Author |
|
|
|
|
|
Use try_append() instead of append().
|
|
This fixes an issue found on Linus's hosted WebServer. Now, if WebServer
is hosted at a non-root URL. (eg, `example.com/webserver` instead of
`example.com`) the links will correctly go to
`example.com/webserver/foo` instead of `example.com/foo`.
|
|
Mostly by copying the code in LibWeb/WebDriver/Client.cpp
|
|
|
|
|
|
|
|
Similar to POSIX read, the basic read and write functions of AK::Stream
do not have a lower limit of how much data they read or write (apart
from "none at all").
Rename the functions to "read some [data]" and "write some [data]" (with
"data" being omitted, since everything here is reading and writing data)
to make them sufficiently distinct from the functions that ensure to
use the entire buffer (which should be the go-to function for most
usages).
No functional changes, just a lot of new FIXMEs.
|
|
Let's make it clear that these functions deal with ASCII case only.
|
|
Also drop the try_ prefix from the fallible function, as it is no longer
needed to distinguish the two.
|
|
...and simply ignore the errors for now. This allows us to remove the
infallible function and avoid accumulating more callers of it.
|
|
|
|
guess_mime_type_based_on_filename() returns a StringView, so no
need to bring DeprecatedString's (implicit) ctor into this.
No behavior change.
|
|
|
|
|
|
|
|
|
|
|
|
As usual, this removes many unused includes and moves used includes
further down the chain.
|
|
|
|
|
|
`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
|
|
This also removes a few cases where the respective header wasn't
actually required to be included.
|
|
|
|
Here, we try to use the new String type for everything internal,
keeping the public interface and the interface to other code the same.
|
|
We've also pulled out the default root path instead of folding it in
with the receiving variables, so that it's uniform across all options
with default values.
|
|
Now, there is nothing that can react to `set_...()` calls, so
offering this possibility can cause wrong assumptions as to what one
can do as soon as a WebServer instance has launched.
The main program can still decide whether to supply the optional
credentials or not, but this way, the configuration can become a Value
Object that won't change after initial creation.
|
|
The concept of a "document root" seems to be a de-facto industry
standard and doesn't make you wonder what kind of root path is meant.
|
|
|
|
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.
Also included are changes to readd now missing dependencies to tools
that actually need them.
|
|
This patch adds a hyperlink that can be hovered over and clicked on to
open the WebServer's index page in Browser.
|
|
Split the path from querystring when determining the requested resource.
|
|
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).
No functional changes.
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
This affects BufferedSeekable::read_until() and ::read_until_any_of().
For the reasoning, see the previous commit about Core::Stream::read().
|
|
|
|
This makes the browser know how much data it should expect.
|
|
|
|
|
|
Apologies for the enormous commit, but I don't see a way to split this
up nicely. In the vast majority of cases it's a simple change. A few
extra places can use TRY instead of manual error checking though. :^)
|
|
|
|
As per previous discussion, it was decided that the Stream classes
should be constructed on the heap.
While I don't personally agree with this change, it does have the
benefit of avoiding Function object reconstructions due to the lambda
passed to Notifier pointing to a stale object reference. This also has
the benefit of not having to "box" objects for virtual usage, as the
objects come pre-boxed.
However, it means that we now hit the heap everytime we construct a
TCPSocket for instance, which might not be desirable.
|
|
This still not propagates errors properly, but is at least (more)
consistent with the codebase.
|
|
|
|
This is intended as a real-usecase test of the Serenity Stream API, and
seemed like a good candidate due to its low amount of users.
|
|
|
|
|