-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: Check Template Validity before downloading #256
feat: Check Template Validity before downloading #256
Conversation
src/modules/downloader.js
Outdated
'X-GitHub-Api-Version': '2022-11-28', | ||
"Accept": "application/vnd.github+json", |
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.
Do we need to set these two HTTP headers? Thanks 🎉
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.
The 'Accept': 'application/vnd.github+json'
header specifies that we want the response in JSON format. However, since JSON is the default format, we can ignore this header.
The 'X-GitHub-Api-Version': '2022-11-28'
header specifies the API version we want to use. If we don't specify this, it will default to the initial release API version, which is also '2022-11-28'
, so we can remove that header as well.
ps: added commits to this pr applying the changes 🎉
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.
Thanks for sending this @viralgupta. Looks great. I added only one inline commend. We can merge this when it's resolved 🎉
Note: Some updates done via 29c7c18 |
Thank you sir, for refactoring my code. I'll aim to write better code in the future. |
right now we dont have a check before downloading the zip to determine if a template is a valid template or not, and the app exits with error not telling the actual issue, I have added a check before downloading the template if
neutralino.config.json
file exists in root directory of the template repository or not to determine if the template is valid or not.Previous Error
Current Error