Skip to content
#

http-server

Here are 2,751 public repositories matching this topic...

caddy
bones-was-here
bones-was-here commented Sep 17, 2021

I have modified the default file_server browse template to integrate it with a website, by using httpInclude to load blocks of HTML containing the header, footer and theme. These files are hosted on the same Caddy instance, and it works well provided that compression is not enabled. When compression is enabled, the file_server browser becomes garbage: it appears that raw compressed data is inc

drogon
hwc0919
hwc0919 commented Aug 20, 2021

Could you make HttpResponse capable of sending part of file by Range header, or by user specified offset and size ?

The TcpConnection class do have a public sendFile method with offset and length parameters, but HttpResponse can not take any advantages of that. Currently it can only send the whole file at one time. Maybe a setRange method would be enough?

Some-Dood
Some-Dood commented Aug 6, 2021

Hello there! After some experimentation with the mocking API, I discovered that mocked contexts do not provide a mocked Cookies instance. Suppose we wanted to test the following middleware:

// session.ts
// Explicit type annotations omitted for brevity...
export function checkSession(ctx) {
    const maybeSessionId = ctx.cookies.get('sid');
    ctx.assert(maybeSessionId, St
ikhoon
ikhoon commented Sep 28, 2021

If a user performs a blocking task in decorator chains or services, they have to 1) submit a task to a blocking task executor,
2) pass the result to a CompletableFuture and 3) wrap the CompletableFuture with HttpResponse.from().

sb.serviceUnder("/web", service.decorate((delegate, ctx, req) -> {
    CompletableFuture<HttpResponse> future = new CompletableFuture<>();
    ctx.bl
tinyhttp

Improve this page

Add a description, image, and links to the http-server topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the http-server topic, visit your repo's landing page and select "manage topics."

Learn more