• URI path issue

    2020-12-08 18:31:14
    <p>I noticed the simplecrawler URI path includes the query string too. Is there any particular reason for this? It causes an issue for me when I want to exclude certain files from the queue using ...
  • URI path. It needs to operate on the encoded path (escaped) such that encoded and decoded URI template values can be correctly returned. <h4>Environment <p>Operating System: All Platform: All</p><p>该...
  • <div><p>The CommandSecurityChecker is creating AzResource URI by URL encoding the URI Path with the following logical operation: <p>new URI(ADMIN_RESOURCE_SCHEME, URLEncoder.encode(resourceName, ...
  • <div><p>The system variable <code>PATH</code> is empty when the URI path has multiple leading slashes. The <code>PARAMS</code> variable contains the URI path. Tested with … <ul><li><code>fatfree-core...
  • <div><p>In order to support the reverse proxy front ending of the Viewer UI, please modify the nodejs viewer to allow for an alternate URI path to be specified. <p>Currently an Apache reverse-proxy ...
  • <div><p>The exception happens whenever handling URI path beginning with two consecutive slashes (three slashes are fine from that perspective). <pre><code> **"stack message"**javax.ws.rs.core....
  • They MUST conform to <a href="https://tools.ietf.org/html/rfc3986#section-3.3">RFC 3986 URI path</a>. Defaults to an empty string.</li><li>Topics MUST now conform to ...
  • <div><p>Extended Camel endpoint ...<p>spring-ws:uripath:/sample/services* <p>This mapping would match following request URIs: <p>http://localhost:8080/sample/services http://somehost/sample/services ...
  • It would be nice if it supported URI path parameter binding also like <code>/api/foo/7</code>. Some RESTful services go further for things like /api/foo/7/bar/15, so some sort of arbitrary path-to-...
  • s node tree which have <em>the same uri path segment</em>. Since we use the URI path segments for routing in the backend, it is not possible, as an editor, to distinguish between the nodes - no matter...
  • <div><p>Hi, ...when server creates new obj.instance, for example,...Uri path" as was in older Leshan version). Perhaps, I missed some updating from OMA specification. Please, find wire-shark logs below ...
  • Server base uri <code>http://localhost:8000/api/v1</code> POST operation <code>/products.create</code></p> <p>I expect POST request <code>...
  • <div><p>fixes the following redirect_uri vulnerabilities (for code and implicit grant types). <p>1 - double url-encoded request <p>registered redirect_uri = http://example.com/foo requested ...
  • <p>I have noticed a difference in behavior between the copy constructor and the copy assignment operator in the uri class. This is the code I used: <pre><code>c++ #include <iostream> #...
  • <div><p>If UriTemplate is not included in WebInvoke, the path does not include the method name. Expected the path to include the method name. When UriTemplate is not included, the default rules are ...
  • <div><p>fixes #101 by preserving trailing slash in path return by the <code>URL's</code> <code>path</code> property</p><p>该提问来源于开源项目:swift-server/async-http-client</p></div>
  • <div><p>We are running cf-release 183. <p>It appears that the ...WEBrick response: <code>Bad Request bad URI</code>http://joe'.`</p><p>该提问来源于开源项目:cloudfoundry/gorouter</p></div>
  • <p>I want to use StripPrefix to remove the first few digits of the path prefix of my uri request, which can work normally in the case of large amounts of data. But there are a few requests that are on...
  • <div><p>该提问来源于开源项目:lightbody/browsermob-proxy</p></div>
  • 我们先来看一下IETF(Internet Engineering Task Force)对URI结构的标准定义(链接): 注意上面的path部分(/over/there)是包含开头的斜杠的。 而微软的眼中偏偏少了开头的这个斜杠——over/there。 当你用...


    我们先来看一下IETF(Internet Engineering Task Force)对URI结构的标准定义(链接):




    当你用微软的IIS Url Rewrite module写匹配规则时,必须要把开头的这个斜杠排除在外。

    当你在ASP.NET MVC中用routes.MapRoute写路由规则时,必须要把开头的这个斜杠排除在外。




    而我今天被折腾,不是因为从非微软平台到微软平台,而只是从Helicon Tech的ISAPI_Rewrite到Microsoft的IIS Url Rewrite module。

    今天在将一个站点从IIS 7.5(Windows Server 2008 R2)迁移至IIS 8.0(Windows Server 2012)后(顺带吐槽一下IIS 8.0竟然与IIS 7.5的配置文件不兼容),发现ISAPI_Rewrite在某些重写规则下会引发IIS应用程序池崩溃(503错误),只能改用IIS Url Rewrite module。

    IIS Url Rewrite module支持从ISAPI_Rewrite的httpd.ini配置文件中导入Url重写规则,但就是因为微软眼中的URI Path与众不同,不得不对每条规则进行修改。之前,博客站点就被这个问题折腾过,今天再次被折腾,心里很不舒服,所以写博客一吐为快!

    作为一名长期使用微软平台的程序员,即使没遇到这个URL重写问题,我也对URI Path中少一个斜杠很不习惯!


    在微软的Url Rewrite module的帮助文档URL Rewrite Module Configuration Reference中,可以找到微软心目中的URI标准是这样的:

    For an HTTP URL in this form: http(s)://<host>:<port>/<path>?<querystring>


  • 说明Android页面之间传递不提供传递Uri类型,但是去截屏页面截图,把图片返回到操作页面显示,需要把相册或者相机的Uri连接传递的。代码 返回:private Uri imageUri; .... Intent intent = new Intent(this, ...






    Intent intent = new Intent(this, GoogleActivity.class);
    intent.putExtra("imageUri", imageUri.toString());


    Uri imageUri = Uri.parse(extras.getString("imageUri"));




  • Path File URI

    千次阅读 2013-01-30 14:12:21
    How to convert between URI and normal file path: Convert normal file path to URI: Uri uri = new Uri(@"c:\Documents\myfile")...Convert URI to normal file path: string normalPath = new Uri(uriPath).Loc
    • How to convert between URI and normal file path:
      • Convert normal file path to URI: Uri uri = new Uri(@"c:\Documents\myfile");
      • Convert URI to normal file path: string normalPath = new Uri(uriPath).LocalPath;
    • How to get file name or file extension from URI or normal file path:
      • string fileName = Path.GetFileName(path); string fileExt = Path.GetExtension(path); // path can be both URI and normal file path.
      • FileInfo fi = new FileInfo(path);  string fileName = fi.Name; string fileExt = fi.Extension. // path can only be normal file path. Disadvantage: must need a FileInfo instance first.
  • Android UriPath

    2016-10-17 14:11:21
  • UriPath

    2016-10-17 14:00:48


         * Try to return the absolute file path from the given Uri
         * @param context
         * @param uri
         * @return the file path or null
        public static String getRealFilePath(Context context, final Uri uri) {
            if (null == uri)
                return null;
            final String scheme = uri.getScheme();
            String data = null;
            if (scheme == null)
                data = uri.getPath();
            else if (ContentResolver.SCHEME_FILE.equals(scheme)) {
                data = uri.getPath();
            } else if (ContentResolver.SCHEME_CONTENT.equals(scheme)) {
                Cursor cursor = context.getContentResolver().query(uri, new String[] { ImageColumns.DATA }, null, null, null);
                if (null != cursor) {
                    if (cursor.moveToFirst()) {
                        int index = cursor.getColumnIndex(ImageColumns.DATA);
                        if (index > -1) {
                            data = cursor.getString(index);
                if (data == null) {
                    data = getImageAbsolutePath(context, uri);
            return data;
        public static Uri getUri(final String filePath) {
            return Uri.fromFile(new File(filePath));
         * 根据Uri获取图片绝对路径,解决Android4.4以上版本Uri转换
         * @param activity
         * @param imageUri
         * @author yaoxing
         * @date 2014-10-12
        public static String getImageAbsolutePath(Context context, Uri imageUri) {
            if (context == null || imageUri == null)
                return null;
            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT && DocumentsContract.isDocumentUri(context, imageUri)) {
                if (isExternalStorageDocument(imageUri)) {
                    String docId = DocumentsContract.getDocumentId(imageUri);
                    String[] split = docId.split(":");
                    String type = split[0];
                    if ("primary".equalsIgnoreCase(type)) {
                        return Environment.getExternalStorageDirectory() + "/" + split[1];
                } else if (isDownloadsDocument(imageUri)) {
                    String id = DocumentsContract.getDocumentId(imageUri);
                    Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
                    return getDataColumn(context, contentUri, null, null);
                } else if (isMediaDocument(imageUri)) {
                    String docId = DocumentsContract.getDocumentId(imageUri);
                    String[] split = docId.split(":");
                    String type = split[0];
                    Uri contentUri = null;
                    if ("image".equals(type)) {
                        contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                    } else if ("video".equals(type)) {
                        contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
                    } else if ("audio".equals(type)) {
                        contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
                    String selection = MediaStore.Images.Media._ID + "=?";
                    String[] selectionArgs = new String[] { split[1] };
                    return getDataColumn(context, contentUri, selection, selectionArgs);
            } // MediaStore (and general)
            else if ("content".equalsIgnoreCase(imageUri.getScheme())) {
                // Return the remote address
                if (isGooglePhotosUri(imageUri))
                    return imageUri.getLastPathSegment();
                return getDataColumn(context, imageUri, null, null);
            // File
            else if ("file".equalsIgnoreCase(imageUri.getScheme())) {
                return imageUri.getPath();
            return null;
        public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
            Cursor cursor = null;
            String column = MediaStore.Images.Media.DATA;
            String[] projection = { column };
            try {
                cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
                if (cursor != null && cursor.moveToFirst()) {
                    int index = cursor.getColumnIndexOrThrow(column);
                    return cursor.getString(index);
            } finally {
                if (cursor != null)
            return null;
         * @param uri
         *                The Uri to check.
         * @return Whether the Uri authority is ExternalStorageProvider.
        public static boolean isExternalStorageDocument(Uri uri) {
            return "com.android.externalstorage.documents".equals(uri.getAuthority());
         * @param uri
         *                The Uri to check.
         * @return Whether the Uri authority is DownloadsProvider.
        public static boolean isDownloadsDocument(Uri uri) {
            return "com.android.providers.downloads.documents".equals(uri.getAuthority());
         * @param uri
         *                The Uri to check.
         * @return Whether the Uri authority is MediaProvider.
        public static boolean isMediaDocument(Uri uri) {
            return "com.android.providers.media.documents".equals(uri.getAuthority());
         * @param uri
         *                The Uri to check.
         * @return Whether the Uri authority is Google Photos.
        public static boolean isGooglePhotosUri(Uri uri) {
            return "com.google.android.apps.photos.content".equals(uri.getAuthority());

    直接调用 getRealFilePath(context,uri);


  • <p>What I would expect to happen is that both the URI and the request path is preserved, it seems odd that the behaviour of the request path is changing depending on how the URI ends. At the very ...
  • URI encode path params

    2020-12-09 01:32:29
    <div><ul><li>Update test snapshot to reflect uri encoded path params</li><li>Update method template to uri encode path params supplied by consumers</li><li>Run npm audit fix to fix some security ...
  • Android UriPath

    2020-12-30 17:00:35
    在Android UriPath的过程中,发现在查询文件管理中的视频时,通过Uri查询系统媒体库得到的存储路径为null,但是可以通过拼接的方式来得到存储路径。 private static String getMediaPathFromUri(Context context...



1 2 3 4 5 ... 20
收藏数 13,467
精华内容 5,386