-
Notifications
You must be signed in to change notification settings - Fork 10
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
Return NoContent for missing (optional) files #174
Conversation
705d5df
to
0c33878
Compare
We had a discussion about this yesterday and feel that the 404 is the correct status for a file that is requested from frontend and should be there. Also the "will soon be deprecated" is something we need to discuss as we can't deprecated it until we have alternative solutions for custom code. |
Why should |
Valid point and probably they shouldn't be treated differently. The reason why the are is probably historical and of no value. We did a quick re-run of yesterdays discussion and realized we didn't consider the optional aspects of these files. Only that a file was requested and it doesn't exists. So the api purists in us won:-D Some of the config files should definitely return 404 as it is an error if they don't exists. These two however, are optional might very well be left blank as well. Approving now, and thx for continuously challenging:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕹️
I'm actually not against the purist opinion, if that would include giving frontend an alternative to just calling the API and look at the response when it wants to know if the old dynamics is used. Maybe a |
I've been looking into something of that sort when implementing this issue: To be more specific, it requests |
Nice! You should probably add the PR to app-lib-dotnet for the endpoint to answer |
* Update nuget non-major dependencies * GetRuleConfiguration now returns NoContent after Altinn/app-lib-dotnet#174 was merged * maxSize in applicationmetadata.json is now repected after Altinn/app-lib-dotnet#121 was merged. Updated testdata * PdfService extended with new PDFClient. Tests not updated to test new service --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vemund Gaukstad <tjololo@users.noreply.github.com>
RuleConfiguration.js
andRuleHandler.js
will soon be deprecated and removed from the app template. Frontend still needs to poll for the files for backwards compatibility, but showing permanent 404 in the browser console is a bad developer experience.This suggest to change the return code to
204
no content,but it should not be released in backend before a released version of frontend is tested and verified to support this new behaviour. It seems to work fine as is.Related Issue(s)
Verification