com.hexagonkt.http.patterns.WildcardPathPattern.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http Show documentation
Show all versions of http Show documentation
HTTP classes. These classes are shared among the HTTP client and the HTTP server.
package com.hexagonkt.http.patterns
import com.hexagonkt.http.patterns.TemplatePathPattern.Companion.WILDCARD
data class WildcardPathPattern(override val prefix: Boolean = false) : PathPattern {
override val pattern: String = WILDCARD
override fun addPrefix(prefix: String?): PathPattern =
if (prefix == null) this
else createPathPattern("$prefix$WILDCARD", this.prefix)
override fun matches(requestUrl: String): Boolean =
true
override fun extractParameters(requestUrl: String): Map =
mapOf(1.toString() to requestUrl)
}