Skip to content
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

fix(runtime): fixed incorrect parsing of return values #453

Merged
merged 7 commits into from
Jan 30, 2024

Conversation

basmasking
Copy link
Member

Fixes #451

Changes proposed in this pull request:

  • Introduced own content-types to indicate the return type (boolean / number)
  • Set the return type based on the content
  • Parse return value based on content type header

@MaskingTechnology/jitar

@basmasking basmasking linked an issue Jan 29, 2024 that may be closed by this pull request
@@ -3,7 +3,9 @@ import checkSecret from '../game/checkSecret';

export default async function guessSecret(secret: string): Promise<string>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export default async function guessSecret(secret: string): Promise<string>
export default async function guessSecret(secret: number): Promise<string>

Is this a good idea? It feels more logical to me. The only consequence is that we have to change the requests from GET to POST so we can provide the correct content type.


import { REQUESTS } from '../_fixtures/services/Remote.fixture';

const remote = new Remote('http://localhost:3000');
Copy link
Member

Choose a reason for hiding this comment

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

Should we create the remote in the fixture?

@petermasking petermasking merged commit d636750 into main Jan 30, 2024
7 checks passed
@petermasking petermasking deleted the 451-proper-content-type-for-return-values branch January 30, 2024 10:05
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.

Proper content type for return values
2 participants