private static NanoResponse maybeServeSpecial ( RequestUri uri ) { assert uri != null ; if ( uri . isHeadMethod ( ) ) { // Blank response used by R's uri.exists("/") if ( uri . getUrl ( ) . equals ( "/" ) ) return new NanoResponse ( HTTP_OK , MIME_PLAINTEXT , "" ) ; } if ( uri . isGetMethod ( ) ) { // url "/3/Foo/bar" => path ["", "GET", "Foo", "bar", "3"] String [ ] path = uri . getPath ( ) ; if ( path [ 2 ] . equals ( "" ) ) return redirectToFlow ( ) ; if ( path [ 2 ] . equals ( "Logs" ) && path [ 3 ] . equals ( "download" ) ) return downloadLogs ( ) ; if ( path [ 2 ] . equals ( "NodePersistentStorage.bin" ) && path . length == 6 ) return downloadNps ( path [ 3 ] , path [ 4 ] ) ; } return null ; }
Handle any URLs that bypass the standard route approach . This is stuff that has abnormal non - JSON response payloads .