OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
1.05k stars 187 forks source link

Fixes web UI for non-existing printer/class #876

Closed TheJayas closed 6 months ago

TheJayas commented 8 months ago

Fixes Issue #423 : When user open the api for any unknown classes or printers, then previously it was showing a random UI with that printer/class name. Now it will throw "404:NOT FOUND" error for those cases. Example for : http://localhost:631/classes/testclass or http://localhost:631/printers/testpriner

TheJayas commented 8 months ago

@tillkamppeter , Please check this pull request and suggest if some changes are required.

TheJayas commented 8 months ago

@michaelrsweet , please review the new changes.

TheJayas commented 8 months ago

Required changes are made. @michaelrsweet please review it.

TheJayas commented 8 months ago

@michaelrsweet I have changed the templates file of classes and printers such that whenever someone directly enter web address like : http://localhost:631/classes/testclass then if there is no class with name "testclass", then that web address will render "ERROR: NO CLASS FOUND". Similiar will happens in case of printers. Previously the above web address was rendering unavailable class with name "testclass" which do not even exists.

TheJayas commented 8 months ago

@tillkamppeter please review the changes.

TheJayas commented 7 months ago

@tillkamppeter , please review the changes, this time I have undo all the changes that were made in .c files and I have changes two templates , "class.tmpl" and "printer.tmpl" to solve the issue.

TheJayas commented 7 months ago

Oh sorry, I think comments are removed by mistake, and that file might be created due to my code editor's fault., these things do not have to do anything with solving issue. Wait, I will resolve these stuffs and with commit the final change again.