Skip to content
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

Fix aeweb case sensitivity for asset names #1580

Conversation

wassimans
Copy link

Description

This pull request addresses the issue of case sensitivity in asset names, which was causing user inconvenience when trying to reference assets with different letter cases. For instance, if an asset was named “Logo.png” and referenced in HTML as “logo.png,” AEWebsite would fail to display the image correctly.

The solution normalizes the URL paths by downcasing them before processing, ensuring that assets can be referenced in a case-insensitive manner.

Fixes #1049

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

To verify the changes, I created a simple test website with an index.html file, style.css, and an image file (Logo.png) in the assets/images folder. I added two image references in the HTML file, one using logo.png and another using LoGo.png. The fix was verified by confirming that both references successfully displayed the image.

I also added a unit test that verifies the url_path is downcased before further processing.

Steps to reproduce:

1.	Create a website with an asset named “Logo.png”.
2.	Reference the image in HTML using “logo.png” or “LoGo.png”.
3.	Run the project to confirm that both references display the image correctly.

•	Test A: Verified website test with multiple image case references.
•	Test B: Unit test added to ensure URL paths are downcased before processing.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@wassimans wassimans added bug Something isn't working API Involve API facing user web hosting issue regarding web hosting labels Oct 18, 2024
@Neylix
Copy link
Member

Neylix commented Oct 18, 2024

Nice job ! First PR 🚀

@wassimans
Copy link
Author

Thanks @Neylix! Wasn't possible without your help.

@Neylix Neylix merged commit f2cbc55 into archethic-foundation:develop Oct 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involve API facing user bug Something isn't working web hosting issue regarding web hosting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with case sensitivity of asset names on AEWeb
3 participants