Repository navigation
Add failing tests for microCMS content-id path traversal - #43
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Server-rendered pages that pass a route value to the fetch helpers let a visitor retarget the API-key request. These tests expect that request to be refused, so they fail until the path is constrained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These tests fail on purpose until content ids and endpoints are constrained to a single path segment before the module calls microCMS. No production code is changed here.
A server-rendered page that passes a route value into
useMicroCMSGetListDetail,useMicroCMSGetList, oruseMicroCMSGetObjectcurrently lets that value change the API-key GET. The suite builds a fixture app, serves it, and records the outbound request. Fourteen cases return another content API's JSON in the page. Six cases already pass: ordinary ids, a path-segment question mark that the router strips before the helper, and a catch-all dot segment that Nuxt 404s before the helper runs.Run:
The command needs the repo dependencies installed (
npm ci). It prepares the playground types, buildstest/fixtures/ssr-app, and expects the hostile cases to make no microCMS request and to omit the other API's body.