@@ -698,16 +698,68 @@ impl Request {
698698 #[ turbo_tasks:: function]
699699 pub async fn request_pattern ( self : Vc < Self > ) -> Result < Vc < Pattern > > {
700700 Ok ( match & * self . await ? {
701- Request :: Raw { path, .. } => path. clone ( ) ,
702- Request :: Relative { path, .. } => path. clone ( ) ,
703- Request :: Module { module, path, .. } => {
701+ Request :: Raw {
702+ path,
703+ query,
704+ fragment,
705+ ..
706+ } => {
707+ let mut path = path. clone ( ) ;
708+ path. push ( Pattern :: Constant ( query. owned ( ) . await ?) ) ;
709+ path. push ( Pattern :: Constant ( fragment. owned ( ) . await ?) ) ;
710+ path. normalize ( ) ;
711+ path
712+ }
713+ Request :: Relative {
714+ path,
715+ query,
716+ fragment,
717+ ..
718+ } => {
719+ let mut path = path. clone ( ) ;
720+ path. push ( Pattern :: Constant ( query. owned ( ) . await ?) ) ;
721+ path. push ( Pattern :: Constant ( fragment. owned ( ) . await ?) ) ;
722+ path. normalize ( ) ;
723+ path
724+ }
725+ Request :: Module {
726+ module,
727+ path,
728+ query,
729+ fragment,
730+ ..
731+ } => {
704732 let mut path = path. clone ( ) ;
705733 path. push_front ( Pattern :: Constant ( module. clone ( ) ) ) ;
734+ path. push ( Pattern :: Constant ( query. owned ( ) . await ?) ) ;
735+ path. push ( Pattern :: Constant ( fragment. owned ( ) . await ?) ) ;
736+ path. normalize ( ) ;
737+ path
738+ }
739+ Request :: ServerRelative {
740+ path,
741+ query,
742+ fragment,
743+ ..
744+ } => {
745+ let mut path = path. clone ( ) ;
746+ path. push ( Pattern :: Constant ( query. owned ( ) . await ?) ) ;
747+ path. push ( Pattern :: Constant ( fragment. owned ( ) . await ?) ) ;
748+ path. normalize ( ) ;
749+ path
750+ }
751+ Request :: Windows {
752+ path,
753+ query,
754+ fragment,
755+ ..
756+ } => {
757+ let mut path = path. clone ( ) ;
758+ path. push ( Pattern :: Constant ( query. owned ( ) . await ?) ) ;
759+ path. push ( Pattern :: Constant ( fragment. owned ( ) . await ?) ) ;
706760 path. normalize ( ) ;
707761 path
708762 }
709- Request :: ServerRelative { path, .. } => path. clone ( ) ,
710- Request :: Windows { path, .. } => path. clone ( ) ,
711763 Request :: Empty => Pattern :: Constant ( "" . into ( ) ) ,
712764 Request :: PackageInternal { path } => path. clone ( ) ,
713765 Request :: DataUri {
@@ -722,8 +774,12 @@ impl Request {
722774 Request :: Uri {
723775 protocol,
724776 remainder,
777+ query,
778+ fragment,
725779 ..
726- } => Pattern :: Constant ( format ! ( "{protocol}{remainder}" ) . into ( ) ) ,
780+ } => Pattern :: Constant (
781+ format ! ( "{protocol}{remainder}{}{}" , query. await ?, fragment. await ?) . into ( ) ,
782+ ) ,
727783 Request :: Unknown { path } => path. clone ( ) ,
728784 Request :: Dynamic => Pattern :: Dynamic ,
729785 Request :: Alternatives { requests } => Pattern :: Alternatives (
0 commit comments