Skip to content

Conversation

@smallstepman
Copy link
Contributor

Description

Continuation of #282. The previous PR incorrectly defined new field in candid spec, which resulted in an incorrect generation of types in e.g. TS:

export interface CreateAssetArguments {
    key: Key;
    content_type: string;
    headers: [] | [HeaderField];
    max_age: [] | [bigint];
}
export declare type HeaderField = [string, string];

This PR fixes that, helping generate correct types (again, TS as an example):

export interface CreateAssetArguments {
  'key' : Key,
  'content_type' : string,
  'headers' : [] | [Array<HeaderField>], // fixed
  'max_age' : [] | [bigint],
}
export type HeaderField = [string, string];

How Has This Been Tested?

manually inspected if generated TS types from candid spec are correct

cargo install --git https://github.com/dfinity/candid didc
didc bind src/ic-certified-assets/assets.did -t ts

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.


## [0.2.4] - 2022-07-12
### Fixed
- headers field in Candid spec accepts mmultiple HTTP headers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- headers field in Candid spec accepts mmultiple HTTP headers
- headers field in Candid spec accepts multiple HTTP headers

@smallstepman smallstepman merged commit 230c734 into main Jul 12, 2022
@smallstepman smallstepman deleted the fix-candid--SDK-473-missing-security-headers branch July 12, 2022 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants