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

🐛 Bug: Nocodb api.dbTableRow does not use URL Encode "/"s #8465

Open
1 task done
TheRushingWookie opened this issue May 13, 2024 · 0 comments
Open
1 task done

🐛 Bug: Nocodb api.dbTableRow does not use URL Encode "/"s #8465

TheRushingWookie opened this issue May 13, 2024 · 0 comments

Comments

@TheRushingWookie
Copy link

TheRushingWookie commented May 13, 2024

Please confirm if bug report does NOT exist already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

Attempt to use a table name with a "/" in it like "example / example" with any of the api.dbTableRow operations.

You'll get a 404 since the "/" is not URL Encoded and a 404 not sent back

NotFoundException: Cannot GET /api/v1/db/data/noco/pmtaar4w390csyx/example%20/%20example
    at callback (/data/repos/nocodb/node_modules/.pnpm/@nestjs+core@10.3.7_@nestjs+common@10.3.7_@nestjs+platform-express@10.3.7_@nestjs+websockets@_o4siayqha5mrcyohpdulxmgok4/node_modules/@nestjs/core/router/routes-resolver.js:77:19)
    at /data/repos/nocodb/node_modules/.pnpm/@nestjs+core@10.3.7_@nestjs+common@10.3.7_@nestjs+platform-express@10.3.7_@nestjs+websockets@_o4siayqha5mrcyohpdulxmgok4/node_modules/@nestjs/core/router/router-proxy.js:9:23
    at Layer.handle [as handle_request] (/data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/index.js:328:13)
    at /data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/index.js:346:12)
    at next (/data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/index.js:280:10)
    at next (/data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/route.js:141:14)
    at next (/data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/route.js:145:7)
    at next (/data/repos/nocodb/node_modules/.pnpm/express@4.19.2/node_modules/express/lib/router/route.js:145:7)

This is likely to due to using encodeURI when we should be using encodeURIComponent as that encodes "/"s

Workaround is to use encodeURIComponents before calling an API which takes a table name

Desired Behavior

The "/" should be URL encoded.

Project Details

Node: v18.19.1
Arch: arm64
Platform: linux
Docker: false
RootDB: sqlite3
PackageVersion: 0.205.0

Attachments

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏌️ Open
Development

No branches or pull requests

1 participant