Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: let splitpath also handle the query intelligently #151

Open
schlichtanders opened this issue Feb 16, 2023 · 0 comments
Open

Comments

@schlichtanders
Copy link

schlichtanders commented Feb 16, 2023

Currently splitpath already extracts path parts from the path string, but
leaves the query string as is, which is too raw for most/all demands which work with the query.

The URIs package already provides the respective extractor function queryparams(::URI). Hence the suggestion to extract this directly in the default function

function splitquery(app, req)
  uri = req[:uri]
  req[:path] = splitpath(uri.path)
  req[:query] = queryparams(uri.query)  # new
  app(req)
end

Edit: if changing the function is too tough because of backwards compatibility, we could name the function splituri instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant