[MGNLDIFF-111] Version Comparison URL Bug when no .html ending is supported Created: 10/Nov/21  Updated: 20/Dec/21  Resolved: 17/Dec/21

Status: Closed
Project: Magnolia Diff Module
Component/s: None
Affects Version/s: 2.2.1
Fix Version/s: 2.2.2

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: VN-Maintenance, maintenance
Remaining Estimate: 0d
Time Spent: 0.5d
Original Estimate: Not Specified

Attachments: Zip Archive httpd.zip    
Issue Links:
Problem/Incident
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Sprint: Global Maintenance 3
Story Points: 5

 Description   

Steps to reproduce

  1. Download the httpd.zip file.
  2. Unzip it
  3. Run in the unzipped directory:
    $ docker build -t httpd-proxyenabled .
    
    $ docker container run \                                    
    --publish 90:80 \
    -d --name apacheserver \
    httpd-proxyenabled
    
  4. First command will build the image and second will start the apache httpd proxy and will forward it to the port 90 to the host machine.
  5. Edit /etc/hosts and add 127.0.0.1    example.com
  6. Start up Magnolia DX Core
  7. Open admincentral at http://example.com:90/magnoliaAuthor
  8. Publish /travel few times
  9. Compare versions in the Pages app

Expected results

The Diff module shows changes between versions

Actual results

An empty screen is shown with apache httpd error.

Workaround

N/A

Development notes

The VersionDiffHtmlServlet.java forces the html ending (hardcoded), it should be taken dynamically from config (e.g, from defaultExtension attribute)

VersionDiffHtmlServlet.java
private String getSourceUrl(HttpServletRequest request, String contentHandle) {
    String baseUrl = StringUtils.substringBefore(request.getRequestURL().toString(), SERVICE_PATH);
    return baseUrl + contentHandle + ".html";
 }

Generated at Mon Feb 12 05:21:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.