Would anyone here happen to know a way to extract ...
# server
j
Would anyone here happen to know a way to extract the hash/target value from the uri of a GET request? (edit: using Ktor - sorry if this is the wrong place for that; I only just realized this channel wasn't ktor-specific after posting). I've tried logging
call.request.uri
and related variables, but it seems that it's getting stripped from the URL. Can't find anything related to this in the documentation (unless I'm looking in entirely the wrong place). Use case: trying to implement an annoyingly nonstandard OAuth process that ends in a redirect to
<http://some.url/#access_token=xxx>
Solved this temporarily by... having my application respond with a JS snippet/page that converts the hash to a query argument (which is then processed as a new request). Yikes.
I've found my mistake here: the target/hash fragment of the URL is only used by the browser, and is never sent to any HTTP server (I didn't realize this before) - so it isn't possible for ktor to retrieve it. This OAuth implementation makes slightly more sense now - but it's still a pain to deal with 😅