Comments (2)
Further investigation traced the issue to https://github.com/improbable-eng/grpc-web/blob/master/client/grpc-web-node-http-transport/src/index.ts#L56
this.options.url
is correctly set to http://localhost:8080/access.AccessAPI/GetAccount
. However, when the code above sets httpOptions
, it does not set the protocol
. Line 66 is executed, calling http.request(httpOptions, ...)
. The body of http.request
looks like the snippet below. TLDR is that it will make the request without the protocol specified, so the browser will append https:
since that is the current window protocol.
http.request = function (opts, cb) {
if (typeof opts === 'string')
opts = url.parse(opts)
else
opts = extend(opts)
// Normally, the page is loaded from http or https, so not specifying a protocol
// will result in a (valid) protocol-relative url. However, this won't work if
// the protocol is something else, like 'file:'
var defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : ''
var protocol = opts.protocol || defaultProtocol
var host = opts.hostname || opts.host
var port = opts.port
var path = opts.path || '/'
// Necessary for IPv6 addresses
if (host && host.indexOf(':') !== -1)
host = '[' + host + ']'
// This may be a relative url. The browser should always be able to interpret it correctly.
opts.url = (host ? (protocol + '//' + host) : '') + (port ? ':' + port : '') + path
opts.method = (opts.method || 'GET').toUpperCase()
opts.headers = opts.headers || {}
// Also valid opts.auth, opts.mode
var req = new ClientRequest(opts)
if (cb)
req.on('response', cb)
return req
}
I'm going to open up an issue on the grpc-web
repo
from fcl-js.
House keeping, tagging and closing in favour of: #321
from fcl-js.
Related Issues (20)
- [BUG] https://rest-mainnet.onflow.org does not appear to be a valid REST/HTTP access node.
- [FEATURE] Send suggested wallet features to Discovery
- [FEATURE] Default to local storage HOT 4
- [BUG] Changesets bot bumping peer dependencies to next major version
- [BUG] [release-typescript] JSDoc regression
- [BUG] Verify FCL works with server components and app router on next
- [BUG] Use ES6 syntax to import buffer HOT 2
- Change package.json author to Flow HOT 1
- Authz/Pre-Authz 2.0.0 Service Specification Proposal HOT 4
- [FEATURE] Receive a user's address when wallet is asked to sign arbitrary message HOT 1
- Release FCL in typescript
- Support increased retry + caching when getting a transactions status HOT 1
- Support event streaming API HOT 3
- [BUG] Login flow broke after FCL update to latest version (1.7.0) HOT 1
- [FEATURE] Add NodeVersionInfo RPC to SDK
- Allow query and mutate support FLIX version 1.1.0
- [BUG] Mark FLIX v1.1.0 as experimental
- [BUG] Issues with type declarations
- [BUG] Dapper Wallet problems with Newer Releases HOT 1
- [BUG] `accessNode.api` does not work if has trailing slash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fcl-js.