Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 6ecf1d5

Browse files
kurmanmhevery
authored andcommitted
feat(http): Allow overriding of recording URL.
Moving hardcoded recorder URL to config class and can be overridden by installing extended PlaybackHttpBackendConfig class in applications. Closes #872
1 parent 212b6f7 commit 6ecf1d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/playback/playback_http.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import 'package:angular/playback/playback_data.dart' as playback_data;
1212

1313
@NgInjectableService()
1414
class PlaybackHttpBackendConfig {
15+
16+
String get recorderUrl => '/record';
17+
1518
requestKey(String url,
1619
{String method, bool withCredentials, String responseType,
1720
String mimeType, Map<String, String> requestHeaders, sendData,
@@ -63,7 +66,7 @@ class RecordingHttpBackend implements HttpBackend {
6366
onProgress: onProgress);
6467

6568
assert(key is String);
66-
_prodBackend.request('/record', //TODO make this URL configurable.
69+
_prodBackend.request(_config.recorderUrl,
6770
method: 'POST', sendData: JSON.encode({
6871
"key": key, "data": JSON.encode({
6972
"status": r.status,

0 commit comments

Comments
 (0)