Skip to content

Conversation

@Jak-Ch-ll
Copy link
Contributor

Closes #91

As I said, this is really the most simple implementation for now. Just an optional bodySerializer option that allows modifying the body.

This is even settable as a global default when creating a custom client, but the types don't reflect that yet. This is because of how the options are typed in general right now. I want to look into that and might come around with some possible improvements.

Additionally, as described in #91, I really want to make the bodySerializer option type safe, so it's mandatory when it's needed. I think the trickiest part with that is the potential of a global default.

@nserver-dokploy
Copy link

🚨 Preview Deployment Blocked - Security Protection

Your pull request was blocked from triggering preview deployments

Why was this blocked?

  • User: Jak-Ch-ll
  • Repository: nuxt-open-fetch
  • Permission Level: read
  • Required Level: write, maintain, or admin

How to resolve this:

Option 1: Get Collaborator Access (Recommended)
Ask a repository maintainer to invite you as a collaborator with write permissions or higher.

Option 2: Request Permission Override
Ask a repository administrator to disable security validation for this specific application if appropriate.

For Repository Administrators:

To disable this security check (⚠️ not recommended for public repositories):
Enter to preview settings and disable the security check.


This security measure protects against malicious code execution in preview deployments. Only trusted collaborators should have the ability to trigger deployments.

🛡️ Learn more about this security feature

This protection prevents unauthorized users from:

  • Executing malicious code on the deployment server
  • Accessing environment variables and secrets
  • Potentially compromising the infrastructure

Preview deployments are powerful but require trust. Only users with repository write access can trigger them.

Copy link
Owner

@Norbiros Norbiros left a comment

Choose a reason for hiding this comment

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

  1. Please run pnpm lint:fix to resolve linter issues
  2. Could you please add a very simple test case for this feature?

Overall looks pretty good as first poc 👍🏻

@Jak-Ch-ll Jak-Ch-ll force-pushed the 91-add-body-serializer branch from 0b1296b to bef061a Compare October 11, 2025 15:23
@Jak-Ch-ll Jak-Ch-ll force-pushed the 91-add-body-serializer branch from bef061a to 52940b2 Compare October 11, 2025 16:56
@Jak-Ch-ll
Copy link
Contributor Author

  1. Please run pnpm lint:fix to resolve linter issues
  2. Could you please add a very simple test case for this feature?

Overall looks pretty good as first poc 👍🏻

Both done, rebased into the existing commits ✅

Honestly I was looking for tests but I didn't expect them in the playground. Should have looked for the test script in the package.json 😅

FYI I originally had the tests in the runtime.spec.ts file in a separate describe block with its own setup call, but when I ran all tests together I got this error:

Error: No context is available. (Forgot calling setup or createContext?)
 ❯ useTestContext ../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_playwrigh_995a05244efc9d5cba00fd3e85dfea15/node_modules/@nuxt/test-utils/dist/shared/test-utils.B8qEdk9k.mjs:53:11
     51|   recoverContextFromEnv();
     52|   if (!currentContext) {
     53|     throw new Error("No context is available. (Forgot calling setup or createContext?)");
       |           ^
     54|   }
     55|   return currentContext;
 ❯ loadFixture ../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_playwrigh_995a05244efc9d5cba00fd3e85dfea15/node_modules/@nuxt/test-utils/dist/shared/test-utils.CT3RJOY3.mjs:79:29
 ❯ beforeAll ../node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_playwrigh_995a05244efc9d5cba00fd3e85dfea15/node_modules/@nuxt/test-utils/dist/shared/test-utils.CT3RJOY3.mjs:181:13

My solution was to create separate test files, which is probably a good idea anyway, depending on your taste in project structure.

The alternative would have been to have an outer describe block that calls setup once for all other describe blocks.

@Norbiros Norbiros merged commit ff96890 into Norbiros:main Oct 12, 2025
2 checks passed
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.

Support multipart/formdata (and other Content-Types)

2 participants