Skip to content

🐛 [Bug]: Slugs that start with . are stripped away #386

@gbyesiltas

Description

@gbyesiltas

Package

storyblok-js-client (Client SDK)

Bug Description

When I make a request to a space with a slug such as: cdn/stories/pages/.something, the resulting network request goes to cdn/stories/pages/.

Steps to Reproduce

  1. Initialise the StoryblokClient from storyblok-js-client with your access token
  2. Find a folder you have content with a "home story" (e.g. cdn/stories/pages/)
  3. Make a request to that folder with cdn/stories/pages/.anything
  4. You will receive the content to the "home story"

Expected Behavior

I would expect to get either a 404 Not found or a 400 Bad request

Actual Behavior

It seems like the part of the slug with . gets stripped away

Code Sample

import StoryblokClient from "storyblok-js-client";

const myClient = new StoryblokClient({
  accessToken: "ACCESS_TOKEN",
});

const story = await myClient.get("cdn/stories/pages/.anything");

console.log(story);

Environment

System:
    OS: macOS 15.7.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 683.41 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 25.2.1 - /Users/gbyesiltas/.n/bin/node
    Yarn: 1.22.22 - /Users/gbyesiltas/.n/bin/yarn
    npm: 11.6.2 - /Users/gbyesiltas/.n/bin/npm
    pnpm: 10.23.0 - /Users/gbyesiltas/.n/bin/pnpm
    bun: 1.2.2 - /Users/gbyesiltas/.bun/bin/bun
    Watchman: 2025.04.28.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 142.0.7444.176
    Firefox: 142.0.1
    Safari: 26.1
    Safari Technology Preview: 26.0
  npmPackages:
    @storyblok/nuxt: 8.2.1 => 8.2.1 
    @storyblok/richtext: 3.8.2 => 3.8.2 
    nuxt: 4.1.3 => 4.1.3 
    vue: 3.5.22 => 3.5.22

Additional Context

We have a nuxt project with a catch-all route, and we see some crawlers trying to randomly access paths like /.DS_Store or /.env and it seems to go to the homepage. While it's not actively breaking much, it does actually cause some errors to appear in our logs and also just feels like unexpected behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions