Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngRoute doesn't support "%" in URLs, throws URI malformed #6326

Closed
@mllrjb

Description

@mllrjb

It looks like ngRoute is doing an extra decodeURIComponent on the $location.$$path value that's passed in. If the path originally contained a URI encoded % (aka %25), then this causes an exception.

    URIError: URI malformed
        at decodeURIComponent (native)
        at switchRouteMatcher (/Users/jason/projects/sandbox/angular.js/src/ngRoute/route.js:469:17)
        at /Users/jason/projects/sandbox/angular.js/src/ngRoute/route.js:562:33

Reproducible: always
Browsers: Chrome 32, Firefox 26 and IE 10
Operating system: OS X

Steps to reproduce:

  • Configure a route with a parameter
      $routeProvider
        .when('/my/route/:param', {
          title: 'home.title',
          templateUrl: 'views/home.html',
          controller: 'HomeCtrl'
        })
  • Use a URI encoded URL to access the route

my/route/some%25route

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions