Comments (16)
Good, I will try to solve it.
from jsonrpc.
@tomusdrw Nope, I was not running with --jsonrpc-cors configured. That fixed it 👍
from jsonrpc.
from Chrome's chrome://net-internals/#events
:
719027: URL_REQUEST
http://localhost:1920/
Start Time: 2017-04-16 23:18:58.760
t=532210 [st=0] +REQUEST_ALIVE [dt=7]
--> priority = "MEDIUM"
--> url = "http://localhost:1920/"
t=532210 [st=0] +URL_REQUEST_DELEGATE [dt=4]
t=532210 [st=0] DELEGATE_INFO [dt=4]
--> delegate_blocked_by = "Adblock Plus-Erweiterung"
t=532214 [st=4] -URL_REQUEST_DELEGATE
t=532214 [st=4] +URL_REQUEST_START_JOB [dt=3]
--> load_flags = 34624 (DO_NOT_SAVE_COOKIES | DO_NOT_SEND_AUTH_DATA | DO_NOT_SEND_COOKIES | MAYBE_USER_GESTURE | VERIFY_EV_CERT)
--> method = "OPTIONS"
--> url = "http://localhost:1920/"
t=532214 [st=4] URL_REQUEST_DELEGATE [dt=0]
t=532214 [st=4] HTTP_CACHE_GET_BACKEND [dt=0]
t=532214 [st=4] +HTTP_STREAM_REQUEST [dt=1]
t=532214 [st=4] HTTP_STREAM_REQUEST_STARTED_JOB
--> source_dependency = 719029 (HTTP_STREAM_JOB)
t=532215 [st=5] HTTP_STREAM_REQUEST_BOUND_TO_JOB
--> source_dependency = 719029 (HTTP_STREAM_JOB)
t=532215 [st=5] -HTTP_STREAM_REQUEST
t=532215 [st=5] +HTTP_TRANSACTION_SEND_REQUEST [dt=0]
t=532215 [st=5] HTTP_TRANSACTION_SEND_REQUEST_HEADERS
--> OPTIONS / HTTP/1.1
Host: localhost:1920
Connection: keep-alive
Access-Control-Request-Method: POST
Origin: null
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Access-Control-Request-Headers: authorization,content-type
Accept: */*
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8
t=532215 [st=5] -HTTP_TRANSACTION_SEND_REQUEST
t=532215 [st=5] +HTTP_TRANSACTION_READ_HEADERS [dt=2]
t=532215 [st=5] HTTP_STREAM_PARSER_READ_HEADERS [dt=1]
t=532216 [st=6] HTTP_TRANSACTION_READ_RESPONSE_HEADERS
--> HTTP/1.1 200 OK
Server: jsonrpc-minihttp-server/7.0.0
Content-Length: 0
Date: Sun, 16 Apr 2017 23:18:58
Content-Type: application/json
Access-Control-Allow-Methods: OPTIONS, POST
Access-Control-Allow-Headers: Origin, Content-Type, Accept
Access-Control-Allow-Origin: null
Vary: Origin
Allow: OPTIONS, POST
Accept: application/json
t=532217 [st=7] -HTTP_TRANSACTION_READ_HEADERS
t=532217 [st=7] URL_REQUEST_DELEGATE [dt=0]
t=532217 [st=7] -URL_REQUEST_START_JOB
t=532217 [st=7] URL_REQUEST_DELEGATE [dt=0]
t=532217 [st=7] HTTP_TRANSACTION_READ_BODY [dt=0]
t=532217 [st=7] -REQUEST_ALIVE
from jsonrpc.
In Chrome console stay - Fetch API cannot load http://localhost:1920/. Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.
from jsonrpc.
@tomusdrw any ideas? :)
from jsonrpc.
RPC server doesn't really support Authorization
so if you're using some kind of a proxy the proxy can alter response headers as well.
That said, Authorization is probably possible to implement using request_middleware
so it may make sense to allow that header. I think the best solution would be to allow people to define Access-Control-Allow-Headers
when configuring the server.
from jsonrpc.
I've renamed the issue accordingly.
from jsonrpc.
@tomusdrw for all transport protocols or only for minihttp?
from jsonrpc.
I think it's only for minihttp
and http
(we try to keep the external API of ServerBuilder
the same for both). Rest of the transports doesn't really have this issue.
from jsonrpc.
Awesome, thanks!
from jsonrpc.
So has there been any changes recently here? I know a few versions back I could add a Parity Custom Node in MEW/MyCrypto just fine however as of now (1.9.2) I'm no longer able to add Parity. See the linked issue above. Should I open a new issue as I'm guessing this isn't 100% related?
from jsonrpc.
@MysticRyuujin Can't tell if the issue is related without more detailed info. Are you sure the node is running with --jsonrpc-cors <frontend-domain>
?
from jsonrpc.
@tomusdrw I would like to implement this and AFAICT there is currently nobody working on the issue. Ok?
from jsonrpc.
@cmichi Correct, no one is working on this. I would also skip the minihttp
part, we might be deprecating that soon unless someone is actually using it (note it doesn't even support transfer-encoding: chunked)
from jsonrpc.
This issue can be closed since #305 was merged.
from jsonrpc.
@cmichi Correct, thanks!
from jsonrpc.
Related Issues (20)
- [ws server]: configuration `ServerBuilder::max_payload` causes unexpected allocations HOT 1
- Incompatible with async_trait?
- WS ERROR in frame.rs
- Request log HOT 1
- how to create new handler when new connection income HOT 1
- Example for Client Support not working HOT 2
- how can i define rpc trait in another mod? HOT 2
- did support config http path for rpc handler, like '/rpc/v0'
- how the jsonrpc params like in rpc trait
- skip params when it is `None`
- How to make bi-directional rpc?
- How to asynchronously process a request in the middleware?
- Expose the parts of jsonrpc_core_client necessary to create a custom transport HOT 2
- Implement the HTTP/2 protocol to increase the number of concurrent requests HOT 1
- Notify should allow Obj Params
- The tcp json server example not worked! HOT 3
- support jsonrpc batch
- Is the project still maintained? HOT 2
- Passing params as struct using derive-macro HOT 1
- Stdio client
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 jsonrpc.