-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add CORS headers to index URL used in URL check. #268
Conversation
Reviewer's Guide by SourceryThis pull request addresses CORS issues in Chrome and Opera by adding CORS headers to the visualizeDIM method in the daliuge-engine/dlg/manager/rest.py file. This is achieved by applying the existing @daliuge_aware decorator to the method, ensuring that the template response includes the necessary CORS headers. File-Level Changes
Tips
|
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.
Hey @myxie - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
def visualizeDIM(self): | ||
""" | ||
Note: this is marked as 'daliuge_aware' in order to get the CORS headers. |
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.
suggestion: Clarify the purpose of the note in the docstring.
The note in the docstring is useful, but it might be clearer if it specifies why CORS headers are necessary for this method. For example, is it because this method is expected to be called from a web client?
Note: this is marked as 'daliuge_aware' in order to get the CORS headers. | |
Note: this is marked as 'daliuge_aware' in order to get the CORS headers. | |
This is necessary because this method is expected to be called from a web client. |
I am going to merge this as the failing tests are due to the recent |
Add CORS headers to index URL used in URL check.
Issue
We have had problems with Chrome and Opera regarding the URL check that occurs when we use the deploy button, which appear to be related to CORS errors being reported:
This is likely caused by the check getting the HEAD of the
dim.html
page, which is served with abottle
template response that does not have CORS headers added (as opposed to all the URL end points attached to the Bottle app).Solution
I have used our existing
@daliuge_aware
decorator to ensure that we add CORS headers to the template response when doing the check.Summary by Sourcery
This pull request addresses CORS errors encountered in Chrome and Opera by adding CORS headers to the 'dim.html' page response using the existing '@daliuge_aware' decorator.