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

Static file server gives error on URL with query at website root #150

Open
FunctionPoint opened this issue Sep 18, 2024 · 1 comment
Open

Comments

@FunctionPoint
Copy link

FunctionPoint commented Sep 18, 2024

Start with a fresh Pharo 13 image.
In a Playground window evaluate:

(ZnServer startDefaultOn: 3000)
    delegate: ( ZnStaticFileServerDelegate new
    directory: 'web' asFileReference;
    yourself).

Where the "web" subfolder contains some basic "index.html" file.

In a browser, browse to: "localhost:3000" and the website is shown correctly.

Now browse to "localhost:3000/?test" and the following error is shown:
"PrimitiveFailed: primitive #basicNew: in Array class failed"
.
Expected behavior:
The website is shown correctly
and the "?test" argument can be retrieved with JavaScript: Windows.location.search.

@FunctionPoint
Copy link
Author

FunctionPoint commented Sep 18, 2024

Checking further:
The error only occurs when the query is at the root level.
For example "localhost:3000/index.html?test" does not give an error and shows the website.
That will be the workaround.. :)

@FunctionPoint FunctionPoint changed the title Static file server gives error on URL with query Static file server gives error on URL with query at website root Sep 18, 2024
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

No branches or pull requests

1 participant