@@ -388,7 +388,7 @@ function $HttpProvider() {
388
388
389
389
/**
390
390
* @ngdoc property
391
- * @name $httpProvider#xsrfWhitelistedOrigins
391
+ * @name $httpProvider#xsrfTrustedOrigins
392
392
* @description
393
393
*
394
394
* Array containing URLs whose origins are trusted to receive the XSRF token. See the
@@ -402,7 +402,7 @@ function $HttpProvider() {
402
402
* Examples: `http://example.com`, `https://api.example.com:9876`
403
403
*
404
404
* <div class="alert alert-warning">
405
- * It is not possible to whitelist specific URLs/paths. The `path`, `query` and `fragment` parts
405
+ * It is not possible to trust specific URLs/paths. The `path`, `query` and `fragment` parts
406
406
* of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be
407
407
* treated as `https://foo.com`, meaning that **all** requests to URLs starting with
408
408
* `https://foo.com/` will include the XSRF token.
@@ -413,9 +413,9 @@ function $HttpProvider() {
413
413
* ```js
414
414
* // App served from `https://example.com/`.
415
415
* angular.
416
- * module('xsrfWhitelistedOriginsExample ', []).
416
+ * module('xsrfTrustedOriginsExample ', []).
417
417
* config(['$httpProvider', function($httpProvider) {
418
- * $httpProvider.xsrfWhitelistedOrigins .push('https://api.example.com');
418
+ * $httpProvider.xsrfTrustedOrigins .push('https://api.example.com');
419
419
* }]).
420
420
* run(['$http', function($http) {
421
421
* // The XSRF token will be sent.
@@ -426,7 +426,7 @@ function $HttpProvider() {
426
426
* }]);
427
427
* ```
428
428
*/
429
- var xsrfWhitelistedOrigins = this . xsrfWhitelistedOrigins = [ ] ;
429
+ var xsrfTrustedOrigins = this . xsrfWhitelistedOrigins = this . xsrfTrustedOrigins = [ ] ;
430
430
431
431
this . $get = [ '$browser' , '$httpBackend' , '$$cookieReader' , '$cacheFactory' , '$rootScope' , '$q' , '$injector' , '$sce' ,
432
432
function ( $browser , $httpBackend , $$cookieReader , $cacheFactory , $rootScope , $q , $injector , $sce ) {
@@ -454,7 +454,7 @@ function $HttpProvider() {
454
454
/**
455
455
* A function to check request URLs against a list of allowed origins.
456
456
*/
457
- var urlIsAllowedOrigin = urlIsAllowedOriginFactory ( xsrfWhitelistedOrigins ) ;
457
+ var urlIsAllowedOrigin = urlIsAllowedOriginFactory ( xsrfTrustedOrigins ) ;
458
458
459
459
/**
460
460
* @ngdoc service
@@ -828,16 +828,16 @@ function $HttpProvider() {
828
828
* The header will — by default — **not** be set for cross-domain requests. This
829
829
* prevents unauthorized servers (e.g. malicious or compromised 3rd-party APIs) from gaining
830
830
* access to your users' XSRF tokens and exposing them to Cross Site Request Forgery. If you
831
- * want to, you can whitelist additional origins to also receive the XSRF token, by adding them
832
- * to {@link ng.$httpProvider#xsrfWhitelistedOrigins xsrfWhitelistedOrigins }. This might be
831
+ * want to, you can trust additional origins to also receive the XSRF token, by adding them
832
+ * to {@link ng.$httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins }. This might be
833
833
* useful, for example, if your application, served from `example.com`, needs to access your API
834
834
* at `api.example.com`.
835
- * See {@link ng.$httpProvider#xsrfWhitelistedOrigins $httpProvider.xsrfWhitelistedOrigins } for
835
+ * See {@link ng.$httpProvider#xsrfTrustedOrigins $httpProvider.xsrfTrustedOrigins } for
836
836
* more details.
837
837
*
838
838
* <div class="alert alert-danger">
839
839
* **Warning**<br />
840
- * Only whitelist origins that you have control over and make sure you understand the
840
+ * Only trusted origins that you have control over and make sure you understand the
841
841
* implications of doing so.
842
842
* </div>
843
843
*
@@ -964,7 +964,7 @@ function $HttpProvider() {
964
964
<file name="script.js">
965
965
angular.module('httpExample', [])
966
966
.config(['$sceDelegateProvider', function($sceDelegateProvider) {
967
- // We must whitelist the JSONP endpoint that we are using to show that we trust it
967
+ // We must add the JSONP endpoint that we are using to the trusted list to show that we trust it
968
968
$sceDelegateProvider.trustedResourceUrlList([
969
969
'self',
970
970
'https://angularjs.org/**'
@@ -1222,7 +1222,7 @@ function $HttpProvider() {
1222
1222
*
1223
1223
* Note that, since JSONP requests are sensitive because the response is given full access to the browser,
1224
1224
* the url must be declared, via {@link $sce} as a trusted resource URL.
1225
- * You can trust a URL by adding it to the whitelist via
1225
+ * You can trust a URL by adding it to the trusted resource URL list via
1226
1226
* {@link $sceDelegateProvider#trustedResourceUrlList `$sceDelegateProvider.trustedResourceUrlList`} or
1227
1227
* by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}.
1228
1228
*
0 commit comments