Skip to content

Fix url params not handled when doinga preview over network#8285

Merged
4ian merged 2 commits into
masterfrom
fix-url-params-network-preview
Feb 16, 2026
Merged

Fix url params not handled when doinga preview over network#8285
4ian merged 2 commits into
masterfrom
fix-url-params-network-preview

Conversation

@ClementPasteau
Copy link
Copy Markdown
Collaborator

@ClementPasteau ClementPasteau commented Feb 16, 2026

Fix #8283

@ClementPasteau ClementPasteau requested a review from 4ian as a code owner February 16, 2026 09:40
Comment thread newIDE/electron-app/app/ServeFolder.js Outdated
// Handle requests with query parameters by serving index.html
// This ensures URLs like http://localhost:2929/?i=123 work correctly
function handleQueryParams(req, res, next) {
const url = new URL(req.url, `http://${req.headers.host}`);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Out of caution, can you add a try catch around this so that if URL throws it still works (url will be unchanged)?

@4ian
Copy link
Copy Markdown
Owner

4ian commented Feb 16, 2026

@cursor Out of caution, can you add a try catch around this so that if URL throws it still works (url will be unchanged)?

@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 16, 2026

I've added a try-catch around the URL parsing in ServeFolder.js. The change wraps the new URL() call so that if it throws an error for any reason, the req.url will remain unchanged and the request will proceed normally through the middleware chain.

Changes made:

  • Wrapped the URL parsing logic in a try-catch block
  • If URL parsing fails, the catch block does nothing (leaving req.url unchanged)
  • The next() call is now outside the try block so it always gets called regardless of whether URL parsing succeeds or fails

Open in Cursor Open in Web

Co-authored-by: Florian Rival <4ian@users.noreply.github.com>
@4ian 4ian merged commit d56ce32 into master Feb 16, 2026
4 of 6 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.

Latest version of Gdevelop (5.6.256+) breaks url query param support

3 participants