-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feature/enable custom headers #220
Feature/enable custom headers #220
Conversation
sidohin-felix
commented
Sep 19, 2023
- Fixes issue for HTTPS hosts by forcing https scheme on port 443
- Allows passing custom headers, in the case the node provider is using headers as a protection mechanism
- Fixes serialization bug of EC keys (which are of length 34 not 33)
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.
Hi @sidohin-felix thank you so much for your feedback and suggested changes. We have finally resolved the issue with key desirlaization in the following PR #255 and will be closing your PR.
Thanks again!
@@ -54,9 +54,28 @@ static CasperService usingPeer(String ip, int port) throws MalformedURLException | |||
CasperObjectMapper objectMapper = new CasperObjectMapper(); |
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.
Thanks for this. Would probably be better to refactor and provide a URL as a parameter here rather than guessing 443 is for HTTPS to allow for non-standard ports. I'll refactor for next release to support this
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.
This issues is resolved in issues/245 there is a new method in casper service:
static CasperService usingPeer(URL url, final Map<String, String> additionalHeaders) throws MalformedURLException
@@ -68,7 +70,23 @@ public void serialize(SerializerBuffer ser, Target target) throws NoSuchTypeExce | |||
|
|||
@Override | |||
public void deserializeCustom(DeserializerBuffer deser) throws Exception { | |||
this.setValue(PublicKey.fromTaggedHexString(ByteUtils.encodeHexString(deser.readByteArray(33)))); | |||
byte[] publicKey; | |||
switch (deser.readByteArray(1)[0]){ |
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.
Can you please provide tests for any changes that are submitted.