File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,9 @@ pub fn source() -> Address {
164164 } )
165165}
166166
167- /// Get query parameters from the current HTTP request path
167+ /// Get query parameters from the current HTTP request path (manually parsed)
168168/// Returns None if not in an HTTP context or no query parameters present
169+ /// NOTE: This manually parses the path string. For pre-parsed params, use get_parsed_query_params()
169170pub fn get_query_params ( ) -> Option < HashMap < String , String > > {
170171 get_path ( ) . map ( |path| {
171172 let mut params = HashMap :: new ( ) ;
@@ -183,6 +184,19 @@ pub fn get_query_params() -> Option<HashMap<String, String>> {
183184 } )
184185}
185186
187+ /// Get the pre-parsed query parameters from the current HTTP request
188+ /// Returns None if not in an HTTP context
189+ /// This accesses the query_params field that Hyperware already parsed (includes URL decoding)
190+ pub fn get_parsed_query_params ( ) -> Option < HashMap < String , String > > {
191+ APP_HELPERS . with ( |helpers| {
192+ helpers
193+ . borrow ( )
194+ . current_http_context
195+ . as_ref ( )
196+ . map ( |ctx| ctx. request . query_params ( ) . clone ( ) )
197+ } )
198+ }
199+
186200pub struct Executor {
187201 tasks : Vec < Pin < Box < dyn Future < Output = ( ) > > > > ,
188202}
You can’t perform that action at this time.
0 commit comments