-
Notifications
You must be signed in to change notification settings - Fork 9
CP-1104 Add noCredentials
config option.
#6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
.project | ||
|
||
/.packages | ||
/.pub | ||
packages | ||
/pubspec.lock | ||
|
||
/coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,21 +6,21 @@ class StatusEvent extends event.Event { | |
StatusEvent(String type, [this.status = 0, this.text = ""]) : super(type); | ||
} | ||
|
||
typedef AbstractXHRObject AjaxObjectFactory(String method, String baseUrl, [payload]); | ||
typedef AbstractXHRObject AjaxObjectFactory(String method, String baseUrl, {bool noCredentials, payload}); | ||
|
||
class AbstractXHRObject extends Object with event.Emitter { | ||
|
||
HttpRequest xhr; | ||
html.HttpRequest xhr; | ||
StreamSubscription changeSubscription; | ||
|
||
Stream get onChunk => this["chunk"]; | ||
Stream get onFinish => this["finish"]; | ||
Stream get onTimeout => this["timeout"]; | ||
|
||
_start(method, url, payload, {noCredentials: false, headers}) { | ||
_start(method, url, payload, {bool noCredentials: false, headers}) { | ||
|
||
try { | ||
xhr = new HttpRequest(); | ||
xhr = new html.HttpRequest(); | ||
} catch(x) {}; | ||
|
||
if ( xhr == null ) { | ||
|
@@ -61,7 +61,7 @@ class AbstractXHRObject extends Object with event.Emitter { | |
xhr.send(payload); | ||
} | ||
|
||
_readyStateHandler(Event evt) { | ||
_readyStateHandler(html.Event evt) { | ||
switch (xhr.readyState) { | ||
case 3: | ||
var text, status; | ||
|
@@ -106,22 +106,22 @@ class AbstractXHRObject extends Object with event.Emitter { | |
} | ||
|
||
class XHRCorsObject extends AbstractXHRObject { | ||
XHRCorsObject(method, url, payload, {noCredentials, headers} ) { | ||
Timer.run(() =>_start(method, url, payload, noCredentials: false)); | ||
XHRCorsObject(method, url, {headers, noCredentials, payload}) { | ||
Timer.run(() =>_start(method, url, payload, noCredentials: noCredentials != null ? noCredentials : false)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can use this null aware op for this bit -> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if i read that right -> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently this project has an SDK constraint of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's skip it for now |
||
} | ||
} | ||
|
||
|
||
|
||
class XHRLocalObject extends AbstractXHRObject { | ||
XHRLocalObject (method, url, payload, {noCredentials, headers}) { | ||
Timer.run(() =>_start(method, url, payload, noCredentials: true)); | ||
XHRLocalObject(method, url, {headers, noCredentials, payload}) { | ||
Timer.run(() =>_start(method, url, payload, noCredentials: noCredentials != null ? noCredentials : true)); | ||
} | ||
} | ||
|
||
XHRLocalObjectFactory(method, baseUrl, [payload]) => new XHRLocalObject(method, baseUrl, payload); | ||
XHRLocalObjectFactory(method, baseUrl, {bool noCredentials, payload}) => new XHRLocalObject(method, baseUrl, noCredentials: noCredentials, payload: payload); | ||
|
||
XHRCorsObjectFactory(method, baseUrl, [payload]) => new XHRCorsObject(method, baseUrl, payload); | ||
XHRCorsObjectFactory(method, baseUrl, {bool noCredentials, payload}) => new XHRCorsObject(method, baseUrl, noCredentials: noCredentials, payload: payload); | ||
|
||
// 1. Is natively via XHR | ||
// 2. Is natively via XDR | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "sockjs-dart-client", | ||
"version": "0.2.0", | ||
"description": "A SockJS client in Dart", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/Workiva/sockjs-dart-client.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Workiva/sockjs-dart-client/issues" | ||
}, | ||
"homepage": "https://github.com/Workiva/sockjs-dart-client", | ||
"devDependencies": { | ||
"http": "0.0.0", | ||
"sockjs": "^0.3.15" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any idea what sort of consumer base this breaking change will have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is only used internally, so I think it's fine