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
fix: platformSelf to send cookies and append f=json in url #778
Conversation
Codecov Report
@@ Coverage Diff @@
## master #778 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 120 120
Lines 1915 1915
Branches 325 325
=========================================
Hits 1915 1915
Continue to review full report at Codecov.
|
@dbouwman @tomwayson Is this setup working for you? |
good catch @noahmulfinger. I didn't try it, myself. Looks like he's right @dbouwman:
|
Thanks @noahmulfinger - the issue is that it's pretty difficult to setup to actually test this fn. I was able to verify that the api works using |
headers: { | ||
"X-Esri-Auth-Client-Id": clientId, | ||
"X-Esri-Auth-Redirect-Uri": redirectUri, | ||
}, |
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.
@dbouwman @noahmulfinger I wonder if we can use the existence of headers
that start w/ "X-Esri-Auth-"
as the signal to request()
that it should set credentials: "include"
?
Rather than introduce any new properties on IRequestOptions
.
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.
That seems reasonable. Another option would be adding a fetchOptions
param or something similar. That way we could allow extra overrides for any future edge cases like this.
Update the recently added
platformSelf
function to send cookies as well as?f=json
in the url.The latter should be a short-term fix as the API should not require it, but currently it will 405 on the OPTIONS pre-flight if that's no in the url as shown