jquery. Refused to set unsafe header "User-Agent" on REST data source

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
  • (Edited)
I created a Skuid Platform to explore what can be done.

1.  I created a new data source that was REST data type.
According to the github API docs, it is required to set these  default headers
  • Accept: application/vnd.github.v3+json
  • User-Agent: joseph-ortiz
2. I created a blank page and added a model with the the newly created data source. 
3. I then previewed the page and noticed in the console that there was error that reads:

"Refused to set unsafe header "User-Agent"

I figure I can create another API that wraps around the github endpoint but wanted to see if you ran into this issue.

the actual call i'm trying to make is

GET /users?since=135 HTTP/1.1Host: api.github.com
User-Agent: joseph-ortiz
Accept: application/vnd.github.v3+json

thanks!
Photo of Joseph Ortiz

Joseph Ortiz

  • 594 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Joseph, are you attempting to connect to Salesforce as an external data source? If so, this known Salesforce issue may be coming into play:
https://success.salesforce.com/issues_view?id=a1p300000008eUCAAY