Skip to content

Commit

Permalink
pass in filters, authenticator for FileContextHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
alterationx10 committed Dec 16, 2024
1 parent 62f9c8b commit 26562f3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.wishingtree.branch.spider.server

import com.sun.net.httpserver.{Authenticator, Filter}
import dev.wishingtree.branch.spider.*
import dev.wishingtree.branch.spider.server.OpaqueSegments.Segments

Expand All @@ -18,8 +19,12 @@ object FileContextHandler {

/** A built-in context handler for serving files from the file system.
*/
case class FileContextHandler(rootFilePath: Segments, contextPath: String = "/")
extends ContextHandler(contextPath) {
case class FileContextHandler(
rootFilePath: Segments,
contextPath: String = "/",
override val filters: Seq[Filter] = Seq.empty,
override val authenticator: Option[Authenticator] = Option.empty
) extends ContextHandler(contextPath) {

private def fileExists(path: Segments): Boolean = {
val filePath = (rootFilePath / path).toPathString
Expand Down

0 comments on commit 26562f3

Please sign in to comment.