Skip to content

Commit 903f5b1

Browse files
Merge pull request #14 from angular/master
Update upstream
2 parents da51467 + 8eb925d commit 903f5b1

File tree

7 files changed

+78
-61
lines changed

7 files changed

+78
-61
lines changed

docs/content/error/$http/baddata.ngdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
@fullName Bad JSON Data
44
@description
55

6-
The default @{link ng.$http#default-transformations `transformResponse`} will try to parse the
7-
response as JSON if the `Content-Type` header is `application/json` or the response looks like a
6+
The default {@link ng.$http#default-transformations `transformResponse`} will try to parse the
7+
response as JSON if the `Content-Type` header is `application/json`, or the response looks like a
88
valid JSON-stringified object or array.
99
This error occurs when that data is not a valid JSON object.
1010

11-
The error message should provide additional context such as the actual response.
12-
13-
To resolve this error, make sure you pass valid JSON data to `transformResponse` or use an
14-
appropriate `Content-Type` header for non-JSON data.
11+
To resolve this error, make sure you pass valid JSON data to `transformResponse`. If the response
12+
data looks like JSON, but has a different `Content-Type` header, you must
13+
{@link ng.$http#overriding-the-default-transformations-per-request implement your own response
14+
transformer on a per request basis}, or {@link ng.$http#default-transformations modify the default `$http` responseTransform}.

karma-shared.conf.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ module.exports = function(config, specificOptions) {
8585
base: 'BrowserStack',
8686
browser: 'chrome',
8787
os: 'OS X',
88-
os_version: 'Yosemite'
88+
os_version: 'Sierra'
8989
},
9090
'BS_Safari': {
9191
base: 'BrowserStack',
9292
browser: 'safari',
9393
os: 'OS X',
94-
os_version: 'Yosemite'
94+
os_version: 'Sierra'
9595
},
9696
'BS_Firefox': {
9797
base: 'BrowserStack',
9898
browser: 'firefox',
9999
os: 'Windows',
100-
os_version: '8'
100+
os_version: '10'
101101
},
102102
'BS_IE_9': {
103103
base: 'BrowserStack',
@@ -120,11 +120,23 @@ module.exports = function(config, specificOptions) {
120120
os: 'Windows',
121121
os_version: '8.1'
122122
},
123-
'BS_iOS': {
123+
'BS_iOS_8': {
124124
base: 'BrowserStack',
125125
device: 'iPhone 6',
126126
os: 'ios',
127-
os_version: '8.0'
127+
os_version: '8.3'
128+
},
129+
'BS_iOS_9': {
130+
base: 'BrowserStack',
131+
device: 'iPhone 6S',
132+
os: 'ios',
133+
os_version: '9.3'
134+
},
135+
'BS_iOS_10': {
136+
base: 'BrowserStack',
137+
device: 'iPhone 7',
138+
os: 'ios',
139+
os_version: '10.0'
128140
}
129141
}
130142
});

lib/browserstack/start_tunnel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PORTS.forEach(function(port) {
2525

2626
var tunnel = new BrowserStackTunnel({
2727
key: ACCESS_KEY,
28-
tunnelIdentifier: TUNNEL_IDENTIFIER,
28+
localIdentifier: TUNNEL_IDENTIFIER,
2929
hosts: hosts
3030
});
3131

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"benchmark": "1.x.x",
2525
"bootstrap": "3.1.1",
2626
"bower": "~1.3.9",
27-
"browserstacktunnel-wrapper": "^1.4.2",
27+
"browserstacktunnel-wrapper": "2.0.0",
2828
"canonical-path": "0.0.2",
2929
"changez": "^2.1.1",
3030
"changez-angular": "^2.1.2",

scripts/travis/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ "$JOB" == "ci-checks" ]; then
99
grunt ci-checks
1010
elif [ "$JOB" == "unit" ]; then
1111
if [ "$BROWSER_PROVIDER" == "browserstack" ]; then
12-
BROWSERS="BS_Chrome,BS_Safari,BS_Firefox,BS_IE_9,BS_IE_10,BS_IE_11,BS_iOS"
12+
BROWSERS="BS_Chrome,BS_Safari,BS_Firefox,BS_IE_9,BS_IE_10,BS_IE_11,BS_iOS_8,BS_iOS_9"
1313
else
1414
BROWSERS="SL_Chrome,SL_Firefox,SL_Safari_8,SL_Safari_9,SL_IE_9,SL_IE_10,SL_IE_11,SL_iOS"
1515
fi

src/ng/http.js

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,6 @@ function $HttpProvider() {
266266
* {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses
267267
* by default. See {@link $http#caching $http Caching} for more information.
268268
*
269-
* - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
270-
* Defaults value is `'XSRF-TOKEN'`.
271-
*
272-
* - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
273-
* XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
274-
*
275269
* - **`defaults.headers`** - {Object} - Default headers for all $http requests.
276270
* Refer to {@link ng.$http#setting-http-headers $http} for documentation on
277271
* setting default headers.
@@ -280,15 +274,38 @@ function $HttpProvider() {
280274
* - **`defaults.headers.put`**
281275
* - **`defaults.headers.patch`**
282276
*
277+
* - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the
278+
* callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the
279+
* {@link $jsonpCallbacks} service. Defaults to `'callback'`.
283280
*
284281
* - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function
285282
* used to the prepare string representation of request parameters (specified as an object).
286283
* If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.
287284
* Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.
288285
*
289-
* - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the
290-
* callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the
291-
* {@link $jsonpCallbacks} service. Defaults to `'callback'`.
286+
* - **`defaults.transformRequest`** -
287+
* `{Array<function(data, headersGetter)>|function(data, headersGetter)}` -
288+
* An array of functions (or a single function) which are applied to the request data.
289+
* By default, this is an array with one request transformation function:
290+
*
291+
* - If the `data` property of the request configuration object contains an object, serialize it
292+
* into JSON format.
293+
*
294+
* - **`defaults.transformResponse`** -
295+
* `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` -
296+
* An array of functions (or a single function) which are applied to the response data. By default,
297+
* this is an array which applies one response transformation function that does two things:
298+
*
299+
* - If XSRF prefix is detected, strip it
300+
* (see {@link ng.$http#security-considerations Security Considerations in the $http docs}).
301+
* - If the `Content-Type` is `application/json` or the response looks like JSON,
302+
* deserialize it using a JSON parser.
303+
*
304+
* - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
305+
* Defaults value is `'XSRF-TOKEN'`.
306+
*
307+
* - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
308+
* XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
292309
*
293310
**/
294311
var defaults = this.defaults = {
@@ -552,15 +569,18 @@ function $HttpProvider() {
552569
*
553570
* AngularJS provides the following default transformations:
554571
*
555-
* Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):
572+
* Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`) is
573+
* an array with one function that does the following:
556574
*
557575
* - If the `data` property of the request configuration object contains an object, serialize it
558576
* into JSON format.
559577
*
560-
* Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):
578+
* Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`) is
579+
* an array with one function that does the following:
561580
*
562581
* - If XSRF prefix is detected, strip it (see Security Considerations section below).
563-
* - If JSON response is detected, deserialize it using a JSON parser.
582+
* - If the `Content-Type` is `application/json` or the response looks like JSON,
583+
* deserialize it using a JSON parser.
564584
*
565585
*
566586
* ### Overriding the Default Transformations Per Request

yarn.lock

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,13 @@ browserstack@1.5.0:
754754
dependencies:
755755
https-proxy-agent "1.0.0"
756756

757-
browserstacktunnel-wrapper@^1.4.2, browserstacktunnel-wrapper@~1.4.2:
757+
browserstacktunnel-wrapper@2.0.0:
758+
version "2.0.0"
759+
resolved "https://registry.yarnpkg.com/browserstacktunnel-wrapper/-/browserstacktunnel-wrapper-2.0.0.tgz#4d6ebf6a667451ad4ee9325fddcf3546607b4d92"
760+
dependencies:
761+
unzip "~0.1.9"
762+
763+
browserstacktunnel-wrapper@~1.4.2:
758764
version "1.4.2"
759765
resolved "https://registry.yarnpkg.com/browserstacktunnel-wrapper/-/browserstacktunnel-wrapper-1.4.2.tgz#6598fb7d784b6ff348e3df7c104b0d9c27ea5275"
760766
dependencies:
@@ -1191,15 +1197,7 @@ concat-map@0.0.1:
11911197
version "0.0.1"
11921198
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
11931199

1194-
concat-stream@^1.4.6, concat-stream@^1.4.7:
1195-
version "1.6.0"
1196-
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7"
1197-
dependencies:
1198-
inherits "^2.0.3"
1199-
readable-stream "^2.2.2"
1200-
typedarray "^0.0.6"
1201-
1202-
concat-stream@~1.4.1, concat-stream@~1.4.5:
1200+
concat-stream@^1.4.6, concat-stream@^1.4.7, concat-stream@~1.4.1, concat-stream@~1.4.5:
12031201
version "1.4.10"
12041202
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.4.10.tgz#acc3bbf5602cb8cc980c6ac840fa7d8603e3ef36"
12051203
dependencies:
@@ -1701,11 +1699,7 @@ domain-browser@~1.1.0:
17011699
version "1.1.7"
17021700
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc"
17031701

1704-
domelementtype@1:
1705-
version "1.3.0"
1706-
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2"
1707-
1708-
domelementtype@~1.1.1:
1702+
domelementtype@1, domelementtype@~1.1.1:
17091703
version "1.1.3"
17101704
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"
17111705

@@ -2244,7 +2238,7 @@ find-up@^1.0.0:
22442238
path-exists "^2.0.0"
22452239
pinkie-promise "^2.0.0"
22462240

2247-
findup-sync@0.4.2:
2241+
findup-sync@0.4.2, findup-sync@^0.4.2:
22482242
version "0.4.2"
22492243
resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.2.tgz#a8117d0f73124f5a4546839579fe52d7129fb5e5"
22502244
dependencies:
@@ -2253,15 +2247,6 @@ findup-sync@0.4.2:
22532247
micromatch "^2.3.7"
22542248
resolve-dir "^0.1.0"
22552249

2256-
findup-sync@^0.4.2:
2257-
version "0.4.3"
2258-
resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.3.tgz#40043929e7bc60adf0b7f4827c4c6e75a0deca12"
2259-
dependencies:
2260-
detect-file "^0.1.0"
2261-
is-glob "^2.0.1"
2262-
micromatch "^2.3.7"
2263-
resolve-dir "^0.1.0"
2264-
22652250
findup-sync@~0.3.0:
22662251
version "0.3.0"
22672252
resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.3.0.tgz#37930aa5d816b777c03445e1966cc6790a4c0b16"
@@ -3110,7 +3095,7 @@ inherits@1:
31103095
version "1.0.2"
31113096
resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b"
31123097

3113-
inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1:
3098+
inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1:
31143099
version "2.0.3"
31153100
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
31163101

@@ -5018,18 +5003,18 @@ pump@^0.3.5:
50185003
end-of-stream "~1.0.0"
50195004
once "~1.2.0"
50205005

5021-
punycode@1.3.2:
5006+
punycode@1.3.2, punycode@>=0.2.0:
50225007
version "1.3.2"
50235008
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
50245009

5025-
punycode@>=0.2.0, punycode@~1.2.3:
5026-
version "1.2.4"
5027-
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.2.4.tgz#54008ac972aec74175def9cba6df7fa9d3918740"
5028-
50295010
punycode@^1.4.1:
50305011
version "1.4.1"
50315012
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
50325013

5014+
punycode@~1.2.3:
5015+
version "1.2.4"
5016+
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.2.4.tgz#54008ac972aec74175def9cba6df7fa9d3918740"
5017+
50335018
q-io@^1.10.9:
50345019
version "1.13.2"
50355020
resolved "https://registry.yarnpkg.com/q-io/-/q-io-1.13.2.tgz#eea130d481ddb5e1aa1bc5a66855f7391d06f003"
@@ -5163,7 +5148,7 @@ read@~1.0.4:
51635148
dependencies:
51645149
mute-stream "~0.0.4"
51655150

5166-
readable-stream@1.1, "readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0.27-1, readable-stream@^1.0.33-1, readable-stream@^1.1.13, readable-stream@^1.1.13-1, readable-stream@~1.1.8, readable-stream@~1.1.9:
5151+
readable-stream@1.1, "readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0.27-1, readable-stream@^1.1.13, readable-stream@^1.1.13-1, readable-stream@~1.1.8, readable-stream@~1.1.9:
51675152
version "1.1.13"
51685153
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e"
51695154
dependencies:
@@ -5172,7 +5157,7 @@ readable-stream@1.1, "readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0
51725157
isarray "0.0.1"
51735158
string_decoder "~0.10.x"
51745159

5175-
"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.0, readable-stream@~1.0.17, readable-stream@~1.0.2, readable-stream@~1.0.26, readable-stream@~1.0.31:
5160+
"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@^1.0.33-1, readable-stream@~1.0.0, readable-stream@~1.0.17, readable-stream@~1.0.2, readable-stream@~1.0.26, readable-stream@~1.0.31:
51765161
version "1.0.34"
51775162
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
51785163
dependencies:
@@ -5181,7 +5166,7 @@ readable-stream@1.1, "readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0
51815166
isarray "0.0.1"
51825167
string_decoder "~0.10.x"
51835168

5184-
readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2:
5169+
readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5:
51855170
version "2.2.2"
51865171
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
51875172
dependencies:
@@ -6312,7 +6297,7 @@ type-is@~1.6.14:
63126297
media-typer "0.3.0"
63136298
mime-types "~2.1.13"
63146299

6315-
typedarray@^0.0.6, typedarray@~0.0.5:
6300+
typedarray@~0.0.5:
63166301
version "0.0.6"
63176302
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
63186303

0 commit comments

Comments
 (0)