This repository was archived by the owner on Feb 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
src/Our.Umbraco.DocTypeGridEditor Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -64,18 +64,15 @@ protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplica
64
64
}
65
65
} ;
66
66
67
- PublishedContentRequest . Prepared += PublishedContentRequest_Prepared ;
68
- }
69
-
70
- private void PublishedContentRequest_Prepared ( object sender , EventArgs e )
71
- {
72
- var request = sender as PublishedContentRequest ;
73
- // Check if it's a dtgePreview request and is set to redirect.
74
- // If so reset the redirect url to an empty string to stop the redirect happening in preview mode.
75
- if ( request . Uri . Query . Contains ( "dtgePreview" ) && request . IsRedirect )
67
+ PublishedContentRequest . Prepared += ( sender , e ) =>
76
68
{
77
- request . SetRedirect ( string . Empty ) ;
78
- }
69
+ // Check if it's a dtgePreview request and is set to redirect.
70
+ // If so reset the redirect url to an empty string to stop the redirect happening in preview mode.
71
+ if ( sender is PublishedContentRequest request && request . Uri . Query . InvariantContains ( "dtgePreview" ) && request . IsRedirect )
72
+ {
73
+ request . SetRedirect ( string . Empty ) ;
74
+ }
75
+ } ;
79
76
}
80
77
}
81
78
}
You can’t perform that action at this time.
0 commit comments