Skip to content

how to parse a uuid from a bearer token header #67

Answered by mackoj
jaredh159 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jaredh159,

I don't really understand your issue here. When I try your code it works as expected.

Example Code
// This Playground was generated by the SPI-Playgrounds app, which is part of the
// Swift Package Index (https://swiftpackageindex.com), using 🏟 Arena
// (https://github.com/finestructure/arena) to import the dependency.
//
// For more information about the SPI-Playgrounds app and to download it, visit
// https://swiftpackageindex.com/try-in-a-playground

import URLRouting
import Foundation

enum AppRoute {
  case home
  case headerAuthed(UUID, AuthedRoute)
}

enum AuthedRoute {
  case foo
  case bar
}

let authedRouter = OneOf {
  Route(.case(AuthedRoute.foo)) {
    Path { "f…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jaredh159
Comment options

Answer selected by jaredh159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants