aboutsummaryrefslogtreecommitdiff
path: root/fs.go
Commit message (Collapse)AuthorAgeFilesLines
* fs: Avoid equality check if lengths don't matchv0.2.1Adnan Maolood2021-04-211-1/+1
|
* fs: Improve redirect behaviorAdnan Maolood2021-04-211-12/+17
|
* fs: RefactorAdnan Maolood2021-04-211-76/+57
|
* fs: Remove ServeContent functionAdnan Maolood2021-04-211-19/+5
|
* fs: Fix panic on indexing URL of zero lengthAdnan Maolood2021-04-211-3/+3
|
* Revert "Require Go 1.16"v0.2.0-rc.2Adnan Maolood2021-03-231-0/+2
| | | | This reverts commit 0e87d64ffc2512563926d15cea6806f47205f7f9.
* fs: Fix empty media type for directory index pagesAdnan Maolood2021-03-201-1/+2
|
* Require Go 1.16Adnan Maolood2021-02-281-2/+0
|
* Don't require Go 1.16Adnan Maolood2021-02-241-0/+2
|
* Move mimetype registration to gemini.goAdnan Maolood2021-02-241-6/+0
|
* fs: Remove build constraintv0.1.15Adnan Maolood2021-02-241-2/+0
|
* fs: Fix Go build constraint commentAdnan Maolood2021-02-241-1/+1
|
* Only use fs.go when fs.FS is availableKaleb Elwert2021-02-241-0/+2
|
* Make ResponseWriter an interfaceAdnan Maolood2021-02-241-6/+6
| | | | | | | Make ResponseWriter an interface with an unexported method. Implementors must embed a ResponseWriter from elsewhere. This gives us the flexibility of an interface while allowing us to add new methods in the future.
* Make ResponseWriter a structAdnan Maolood2021-02-231-6/+6
| | | | | Make ResponseWriter a struct again so that it can be extended in a backwards-compatible way.
* Update documentationAdnan Maolood2021-02-231-3/+3
|
* Rename ResponseWriter.MediaType to SetMediaTypeAdnan Maolood2021-02-211-1/+1
|
* fs: Use better error messagesAdnan Maolood2021-02-211-2/+13
|
* fs: Remove unused context argumentsAdnan Maolood2021-02-211-8/+8
|
* handler: Make ServeGemini accept a ContextAdnan Maolood2021-02-201-9/+10
|
* Redesign ResponseWriter interfaceAdnan Maolood2021-02-171-9/+9
|
* fs: Reject potentially unsafe requests in ServeFileAdnan Maolood2021-02-171-0/+36
| | | | | | Reject requests where r.URL.Path contains a ".." path element to protect against callers who might unsafely use filepath.Join on r.URL.Path without sanitizing it.
* fs: Add ServeContent functionAdnan Maolood2021-02-171-5/+19
|
* fs: Fix redirect to canonical file pathAdnan Maolood2021-02-171-1/+1
|
* fs: Add redirectsAdnan Maolood2021-02-171-4/+41
|
* fs: Trim trailing slash from name in ServeFileAdnan Maolood2021-02-171-1/+1
|
* fs: Clean paths before handling with FileServerAdnan Maolood2021-02-171-1/+1
|
* fs: Show listing for directories without index filesAdnan Maolood2021-02-171-30/+57
|
* fs: Remove leading slash before opening filesAdnan Maolood2021-02-161-0/+6
|
* fs: Replace FileSystem with io/fs.FSAdnan Maolood2021-02-161-50/+8
|
* fs: RefactorAdnan Maolood2021-02-141-55/+77
|
* fs: Update documentationAdnan Maolood2021-02-141-12/+2
|
* Make ResponseWriter an interfaceAdnan Maolood2021-02-091-2/+2
|
* Rename Responder to HandlerAdnan Maolood2021-02-081-4/+5
|
* fs: Remove unused importv0.1.12Adnan Maolood2021-01-141-1/+0
|
* fs: Update commentsAdnan Maolood2021-01-141-2/+2
|
* fs: Don't panic on mime.AddExtensionType errorAdnan Maolood2021-01-141-7/+2
| | | | It's probably best not to panic if this fails.
* fs: Update commentsAdnan Maolood2021-01-141-2/+11
|
* Simplify ResponseWriter implementationAdnan Maolood2021-01-101-2/+2
|
* Add missing error handlingHugo Wetterberg2021-01-091-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error handling is currently missing is a couple of places. Most of them are i/o related. This change adds checks, an therefore sometimes also has to change function signatures by adding an error return value. In the case of the response writer the status and meta handling is changed and this also breaks the API. In some places where we don't have any reasonable I've added assignment to a blank identifier to make it clear that we're ignoring an error. text: read the Err() that can be set by the scanner. client: check if conn.SetDeadline() returns an error. client: check if req.Write() returns an error. fs: panic if mime type registration fails. server: stop performing i/o in Header/Status functions By deferring the actual header write to the first Write() or Flush() call we don't have to do any error handling in Header() or Status(). As Server.respond() now defers a ResponseWriter.Flush() instead of directly flushing the underlying bufio.Writer this has the added benefit of ensuring that we always write a header to the client, even if the responder is a complete NOOP. tofu: return an error if we fail to write to the known hosts writer.
* Rename (*ResponseWriter).SetMimetype to SetMediaTypeAdnan Maolood2020-11-091-2/+2
|
* Remove some unnecessary errorsAdnan Maolood2020-11-041-2/+2
|
* Use strings.Builder in FingerprintAdnan Maolood2020-10-281-5/+4
|
* Add ServeFile functionv0.1.2Adnan Maolood2020-10-271-0/+21
|
* Add (*ResponseWriter).WriteStatus functionAdnan Maolood2020-10-271-1/+1
|
* Update documentationv0.1.0Adnan Maolood2020-10-241-2/+2
|
* Rename repository to go-geminiAdnan Maolood2020-10-241-1/+1
|
* Rename Handler to ResponderAdnan Maolood2020-10-211-2/+2
|
* Rename rw, req to w, radnano2020-10-131-5/+5
|
* Move errors to gemini.goadnano2020-10-131-6/+0
|