All Downloads are FREE. Search and download functionalities are using the official Maven repository.

skinny.micro.util.UriDecoder.scala Maven / Gradle / Ivy

The newest version!
package skinny.micro.util

import skinny.micro.routing.PathPatternParser
import skinny.micro.rl.UrlCodingUtils

object UriDecoder {

  def firstStep(uri: String): String = {
    UrlCodingUtils.urlDecode(
      toDecode = UrlCodingUtils.ensureUrlEncoding(uri),
      toSkip = PathPatternParser.PathReservedCharacters)
  }

  def secondStep(uri: String): String = {
    uri.replaceAll("%23", "#")
      .replaceAll("%2F", "/")
      .replaceAll("%3F", "?")
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy