-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[TS SDK] Support contentType in request #8977
Conversation
1917b23
to
bb5c716
Compare
expect(true).toBe(false); | ||
} | ||
}, | ||
longTestTimeout, |
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.
Curious, why do we include a longTestTimeout on every test now?
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.
it is flaky on how much time it takes for the test to complete, if you notice we use it on most of the tests we just didn't have it on this file
endpoint: "transactions", | ||
body: bcsTxn, | ||
originMethod: "test request includes all headers", | ||
mediaType: "application/x.aptos.signed_transaction+bcs", |
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.
I see, so when the request is a bcs serialized txn, the content type need to be set to application/x.aptos.signed_transaction+bcs
? Hmm not sure if I seen this in Python nor Rust sdk
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.
interesting.... we should have it, without it API explodes lol
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.
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.
ohhh nice find!
@@ -26,12 +26,14 @@ async function axiosRequest<Request, Response>( | |||
url: string, | |||
method: "GET" | "POST", | |||
body?: Request, | |||
mediaType?: string, |
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.
Let's call it contentType instead, since that's the actual header we're using.
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.
done
bb5c716
to
9666466
Compare
9666466
to
96f08ae
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
Current implementation overrides existing
'content-type':'application/x.aptos.signed_transaction+bcs'
header when passing in custom headers.This PR adds
contentType
support that when submitting a transaction, the expected content type would be set.more context here https://aptos-org.slack.com/archives/C04D0LSBVJN/p1688610023758839
Test Plan
tests are passing
added specific test https://github.com/aptos-labs/aptos-core/compare/add_mediaType_to_request?expand=1#diff-9187cd50043dfc9d3829abdb7a919d2497b633279daa100db09194b2d6509366R45