Skip to content

Fix CSS lookup for simulator server#2904

Merged
janiversen merged 1 commit into
pymodbus-dev:devfrom
KevinWMatthews:km/fix-simulator-css
Mar 12, 2026
Merged

Fix CSS lookup for simulator server#2904
janiversen merged 1 commit into
pymodbus-dev:devfrom
KevinWMatthews:km/fix-simulator-css

Conversation

@KevinWMatthews
Copy link
Copy Markdown
Contributor

Fix CSS lookup when running pymodbus.simulator.

Currently, the pymodbus simulator fails to load CSS:

Before

pymodbus_simulator_before

With this change, I observe CSS loading:

After

pymodbus_simulator_after

Background

I can confirm that I observed a 404 on the pymodbus_styles.css:

pymodbus_styles.css:1  Failed to load resource: the server responded with a status of 404 (Not Found)
pymodbus_styles.css:1  Failed to load resource: the server responded with a status of 404 (Not Found)

in both Chrome and Firefox.

I suspect that this regex will only serve files that contain the characters:

  • a-z (lowercase letters)
  • 0-9 (digits)
  • . (any number of)

I did confirm that an alternative solution would work:

  • rename all pymodbus_styles.css references to pymodbusstyles.css
  • rename the file itself to pymodbusstyles.css

This removes the _, allowing the existing regex to work. However, I proposed what I feel is a more light-weight solution: extending the regex.

Copy link
Copy Markdown
Collaborator

@janiversen janiversen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@janiversen janiversen merged commit f5b10e3 into pymodbus-dev:dev Mar 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants