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: Empty Input Cannot Be Processed #73

Closed
niedzielski opened this issue Apr 4, 2017 · 2 comments · Fixed by #124
Closed

Bug: Empty Input Cannot Be Processed #73

niedzielski opened this issue Apr 4, 2017 · 2 comments · Fixed by #124
Labels

Comments

@niedzielski
Copy link

The validator is unable to process empty input files and produces the following error both on direct input and empty file input:

CSS
Validator
Error
Target: No file

I/O Error: You have sent an invalid request.
@niedzielski niedzielski changed the title Bug: Empty Input Bug: Empty Input Cannot Be Processed Apr 4, 2017
sideshowbarker added a commit that referenced this issue Dec 27, 2017
This change improves handling for empty input in the Web UI — for all input
cases (URI, file-upload, textarea/direct-input).

It adds client-side form validation to the Web UI, so that users get error
messages in the Web UI itself and won’t be able to submit empty input to the
server to begin with.

And if a user manages to bypass the client-side validation and submits empty
input to the server, the server redirects the request back in such a way that
the same error messages are shown to the user in the Web UI.

So users see the same error messages in the Web UI regardless of whether the
empty-input problem was caught on the server side, or else on the client side
before being submitted to the server.

Fixes #73 Thanks @niedzielski
sideshowbarker added a commit that referenced this issue Dec 27, 2017
This change improves handling for empty input in the Web UI — for all input
cases (URI, file-upload, textarea/direct-input).

It adds client-side form validation to the Web UI, so that users get error
messages in the Web UI itself and won’t be able to submit empty input to the
server to begin with.

And if a user manages to bypass the client-side validation and submits empty
input to the server, the server redirects the request back in such a way that
the same error messages are shown to the user in the Web UI.

So users see the same error messages in the Web UI regardless of whether the
empty-input problem was caught on the server side, or else on the client side
before being submitted to the server.

Relates to #73
@sideshowbarker
Copy link
Contributor

What response would you want to have instead for the case where the input is empty?

@niedzielski
Copy link
Author

Success is expected since no CSS is valid CSS. This configuration won't require tools that process multitudes of files to filter out empty inputs.

sideshowbarker added a commit that referenced this issue Dec 28, 2017
This change makes the server (servlet) allow empty file-upload input and
empty text/direct-input from POST requests — including from requests
made with the HTTP POST API — and to respond with a success message.

That more closely aligns the POST handling with the existing GET
handling; e.g., http://localhost:8080/css-validator/validator?text=,
which allows the `text` query parameter to be empty, and treats such
content as conforming (because empty CSS documents are valid).

Fixes #73. Thanks @niedzielski
sideshowbarker added a commit that referenced this issue Dec 28, 2017
This change makes the server (servlet) allow empty file-upload input and
empty text/direct-input from POST requests — including from requests
made with the HTTP POST API — and to respond with a success message.

That more closely aligns the POST handling with the existing GET
handling; e.g., https://jigsaw.w3.org/css-validator/validator?text=,
which allows the `text` query parameter to be empty, and treats such
content as conforming (because empty CSS documents are valid).

Fixes #73. Thanks @niedzielski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants