-
-
Notifications
You must be signed in to change notification settings - Fork 48
Resolving 4XX errors on the CDN #1171
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
Conversation
max-ostapenko
commented
Dec 9, 2025
- Add icon existence checks and warnings in ComboBox, TechReport, and TableLinked components
…ableLinked components
…d TableLinked components
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.
Pull request overview
This PR addresses 4XX errors on the CDN by adding defensive checks to prevent requests for missing icon files. The changes ensure that icon elements are only created and appended to the DOM when the icon property exists.
Key Changes:
- Added null/undefined checks for icon properties before creating icon elements across multiple components
- Improved URL encoding approach in
getTechInfo()to useencodeURIComponentwith proper join syntax
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/js/techreport/tableLinked.js |
Added icon existence check before creating background-image span element |
src/js/techreport/index.js |
Added icon checks in getTechInfo() and updateDrilldownComponents(), improved URL encoding for technology parameters |
src/js/techreport/combobox.js |
Added icon existence checks before creating img elements in dropdown options and selected items display |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if(icon) { | ||
| const logo = document.createElement('img'); | ||
| logo.setAttribute('alt', ''); | ||
| logo.setAttribute('src', `https://cdn.httparchive.org/v1/static/icons/${icon}`); |
Copilot
AI
Dec 9, 2025
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.
Inconsistent URL encoding: The icon at line 35 is used directly without encodeURI(), but the icon at line 206 uses encodeURI(icon). For consistency and to prevent potential URL issues with special characters in icon filenames, both should use encodeURI() or encodeURIComponent().
| logo.setAttribute('src', `https://cdn.httparchive.org/v1/static/icons/${icon}`); | |
| logo.setAttribute('src', `https://cdn.httparchive.org/v1/static/icons/${encodeURI(icon)}`); |