summaryrefslogtreecommitdiff
path: root/Userland/Services/WebServer
AgeCommit message (Collapse)Author
2023-05-21WebServer: Convert document_root_path from DeprecatedString to StringBen Wiederhake
2023-05-21WebServer: Prefer LibFileSystem over DeprecatedFileBen Wiederhake
2023-03-27WebServer: Propagate more errorsSam Atkins
Use try_append() instead of append().
2023-03-27WebServer: Use relative URLs for the directory listingSam Atkins
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`.
2023-03-27WebServer: Handle incomplete HTTP requestsSam Atkins
Mostly by copying the code in LibWeb/WebDriver/Client.cpp
2023-03-26LibHTTP+WebDriver+WebServer: Return error from HTTP request parserAliaksandr Kalenik
2023-03-21Everywhere: Use `LibFileSystem` where trivialCameron Youell
2023-03-13Everywhere: Remove unintentional partial stream reads and writesTim Schumacher
2023-03-13AK: Rename Stream::{read,write} to Stream::{read_some,write_some}Tim Schumacher
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.
2023-03-10Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_caseAndreas Kling
Let's make it clear that these functions deal with ASCII case only.
2023-03-09AK: Remove infallible version of StringBuilder::to_byte_bufferLinus Groh
Also drop the try_ prefix from the fallible function, as it is no longer needed to distinguish the two.
2023-03-09WebServer+LibGUI: Use fallible version of StringBuilder::to_byte_bufferLinus Groh
...and simply ignore the errors for now. This allows us to remove the infallible function and avoid accumulating more callers of it.
2023-03-09WebServer: Use fallible version of StringBuilder::to_byte_bufferKarol Baraniecki
2023-02-26WebServer: Remove a call to String::from_deprecated_stringNico Weber
guess_mime_type_based_on_filename() returns a StringView, so no need to bring DeprecatedString's (implicit) ctor into this. No behavior change.
2023-02-25Everywhere: Use _{short_,}string to create Strings from literalsLinus Groh
2023-02-13Everywhere: Remove the `AK::` qualifier from Stream usagesTim Schumacher
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2023-02-13LibCore: Move Stream-based file into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Move Stream-based sockets into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.
2023-02-08AK: Remove the fallible constructor from `FixedMemoryStream`Tim Schumacher
2023-01-29AK: Move memory streams from `LibCore`Tim Schumacher
2023-01-29AK: Move `Stream` and `SeekableStream` from `LibCore`Tim Schumacher
`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.
2023-01-29AK: Deprecate the old `AK::Stream`Tim Schumacher
This also removes a few cases where the respective header wasn't actually required to be included.
2023-01-20WebServer: Use `Core::Stream` to read served filesTim Schumacher
2022-12-26WebServer: Use new String type internally as much as possibleThomas Keppler
Here, we try to use the new String type for everything internal, keeping the public interface and the interface to other code the same.
2022-12-26WebServer: Use new String type for default option valuesThomas Keppler
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.
2022-12-26WebServer: Require document root and credentials as config init paramsThomas Keppler
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.
2022-12-26WebServer: Rename {real_}root_path to {real_}document_root_pathThomas Keppler
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.
2022-12-20AK: Stop using `DeprecatedString` in Base64 encodingJelle Raaijmakers
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
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.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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 :^)
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
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.
2022-09-05WebServer: Make bound socket a clickable hyperlink :^)networkException
This patch adds a hyperlink that can be hovered over and clicked on to open the WebServer's index page in Browser.
2022-08-02LibHTTP+WebServer: Add querystring support0xbigshaq
Split the path from querystring when determining the requested resource.
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
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.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
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.
2022-04-16LibCore+Everywhere: Make Core::Stream read_until() return BytesSam Atkins
This affects BufferedSeekable::read_until() and ::read_until_any_of(). For the reasoning, see the previous commit about Core::Stream::read().
2022-04-09WebServer: Add utf-8 charset to Content-Type header for text/plainLady Gegga
2022-03-19WebServer: Add Content-Length header to HTTP responsesMaciej
This makes the browser know how much data it should expect.
2022-02-18WebServer: Close the socket if Connection: keep-alive isn't requestedAli Mohammad Pur
2022-01-27WebServer: Unveil /etc/timezone for readingAndreas Kling
2022-01-24Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOrSam Atkins
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. :^)
2022-01-14WebServer: Add charset declaration to directory listingsMaciej
2022-01-13LibCore+Userland+Tests: Convert Stream APIs to construct on heapsin-ack
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.
2022-01-03WebServer: Make ErrorOr unwrapping more idiomaticMaciej
This still not propagates errors properly, but is at least (more) consistent with the codebase.
2021-12-27LibCore+Services: Make TCPServer propagate errorsSam Atkins
2021-12-16LibCore+Userland: Convert TCPServer to use the Serenity Stream APIsin-ack
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.
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-23WebServer: Port to LibMain :^)Andreas Kling