More orbit cleanup#40
Merged
Merged
Conversation
The assignment list feature was still referencing the server name variable I think if we really want the domain name, we can just include it in the db entry or hardcode the value in the script. Fixes: 45cbbb3 ("orbit: remove unused entries in config.py")
Fixes: 99145c2 ("orbit: config: remove ability to run config.py as a script")
PhDs in computer science hate this one weird trick to avoid a pyramid of doom with nested conditionals!
Using a standard http method 302 to redirect is better.
Previously, if you went to a page that nginx could determine was invalid e.g. /index.mdX it would sent you the proper 404 error page with bold text, but if you went to a page that produced a 404 through the proxy e.g. /indexX.md (still matches .md regex to it goes to proxy, but there is no markdown source) you would get a different 404 page without bold text. The proper way to keep them in sync is to have nginx intercept those errors and apply the normal error page logic.
bbc97b9 to
ab558f1
Compare
cc350bf to
0e8208f
Compare
since nginx is now intercepting errors, the body of the response from orbit when an error occurs is not longer nessecary to include.
Instead of adding code to do this kind of check to each function, we can just filter out all requests that aren't appropriate for any route at the top level.
Previously a non get request could be sent to many paths that would just assume it is a get request. Only those which support get and post should be able to recieve both. Otherwise, only GET. POST requests should get a 405.
All occurances of the function were using HTTPStatus.OK, so it is no longer nessecary to specify it. Callers wishing to provide a different response code should use raw_response primitive.
0e8208f to
5717eea
Compare
Contributor
passes the tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should really have been part of #38 but I rushed that one of out of the door.