File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -50,15 +50,18 @@ const maybeProxy = (req: Request): string | undefined => {
50
50
* through to allow the redirect and login flow.
51
51
*/
52
52
const shouldFallThrough = ( req : Request ) : boolean => {
53
- // The ideal would be to have a reliable way to detect if this is a request
54
- // for (or originating from) our root or login HTML. But requests for HTML
55
- // don't seem to set any content type.
56
- return (
57
- req . headers [ "content-type" ] !== "application/json" &&
58
- ( ( req . originalUrl . startsWith ( "/" ) && req . method === "GET" ) ||
59
- ( req . originalUrl . startsWith ( "/static" ) && req . method === "GET" ) ||
60
- ( req . originalUrl . startsWith ( "/login" ) && ( req . method === "GET" || req . method === "POST" ) ) )
61
- )
53
+ // See if it looks like a request for the root or login HTML.
54
+ if ( req . accepts ( "text/html" ) ) {
55
+ if (
56
+ ( req . path === "/" && req . method === "GET" ) ||
57
+ ( / \/ l o g i n \/ ? / . test ( req . path ) && ( req . method === "GET" || req . method === "POST" ) )
58
+ ) {
59
+ return true
60
+ }
61
+ }
62
+
63
+ // See if it looks like a request for a static asset.
64
+ return req . path . startsWith ( "/static/" ) && req . method === "GET"
62
65
}
63
66
64
67
router . all ( "*" , ( req , res , next ) => {
You can’t perform that action at this time.
0 commit comments