angular-docs-cn/packages/platform-server
Alex Rickabaugh 15a082c74e fix(platform-server): throw a better error message for relative URLs (#15357)
Unlike in the browser, on the server there is no concept of a document origin.
Thus, it is illegal to make requests for relative URLs against Http on platform-server.

Currently this fails with a vague error:

Error: Uncaught (in promise): Error at resolvePromise

This change adds explicit validation and a friendlier error message:

Error: URLs requested via Http on the server must be absolute. URL: /testing

Another option considered was to track the concept of an origin for the platform
and automatically prepend it to relative URLs. This would cause automatic "local
RPCs" to be made, though, which would be an unexpected and undesirable default
behavior.

Fixes #15349

PR Close #15357
2017-03-21 14:26:51 -05:00
..
integrationtest fix(platform-server): setup NoopAnimationsModule in ServerModule by default (#15131) 2017-03-17 16:21:51 -05:00
src fix(platform-server): throw a better error message for relative URLs (#15357) 2017-03-21 14:26:51 -05:00
test fix(platform-server): throw a better error message for relative URLs (#15357) 2017-03-21 14:26:51 -05:00
testing test: add systemjs+umd integration test (#14196) 2017-03-19 12:23:07 -05:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
package.json fix(platform-server): setup NoopAnimationsModule in ServerModule by default (#15131) 2017-03-17 16:21:51 -05:00
public_api.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
rollup.config.js test: add systemjs+umd integration test (#14196) 2017-03-19 12:23:07 -05:00
tsconfig-build.json fix(platform-server): setup NoopAnimationsModule in ServerModule by default (#15131) 2017-03-17 16:21:51 -05:00