File tree Expand file tree Collapse file tree
ext/opentelemetry-ext-asgi/src/opentelemetry/ext/asgi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,11 +83,11 @@ def collect_request_attributes(scope):
8383 server_host = server [0 ] + (":" + str (port ) if port != 80 else "" )
8484 full_path = scope .get ("root_path" , "" ) + scope .get ("path" , "" )
8585 http_url = scope .get ("scheme" , "http" ) + "://" + server_host + full_path
86- if scope .get ("query_string" ) and http_url :
87- if isinstance ( scope [ " query_string" ], bytes ) :
88- http_url = http_url + ( "?" + scope . get ( " query_string" ). decode ( "utf8" ))
89- else :
90- http_url = http_url + ("?" + urllib .parse .unquote (scope . get ( " query_string" ) ))
86+ query_string = scope .get ("query_string" )
87+ if query_string and http_url :
88+ if isinstance ( query_string , bytes ):
89+ query_string = query_string . decode ( "utf8" )
90+ http_url = http_url + ("?" + urllib .parse .unquote (query_string ))
9191
9292 result = {
9393 "component" : scope ["type" ],
You can’t perform that action at this time.
0 commit comments