You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "toaditi (via GitHub)" <gi...@apache.org> on 2026/06/30 11:46:57 UTC
[PR] Fixed: The port offset is being applied twice when loading WebSite properties (OFBIZ-13352) [ofbiz-framework]
toaditi opened a new pull request, #1392:
URL: https://github.com/apache/ofbiz-framework/pull/1392
**JIRA:** [OFBIZ-13352](https://issues.apache.org/jira/browse/OFBIZ-13352)
`WebSiteProperties.from(HttpServletRequest)` delegates to `from(GenericValue)` when the request resolves to a `WebSite` entity. `from(GenericValue)` already applies the configured port offset, but the request method then applied it a **second time**, so with a non-zero `portOffset` the generated http and https ports were offset twice.
This builds on the approach in #949 (thanks @Lukas-Finster). #949 fixes the **https** port; this change also covers the **http** port, which is still offset twice there because `addPortOffset(boolean addHttpsOffset)` offsets the http port *unconditionally* (the flag only guards the https part). Rather than toggling the flag, this skips the offset call entirely on the WebSite-entity path (where the offset is already applied), and keeps a separate `addHttpsOffset` flag for the "https port taken from the request" case.
### Verification
Ran OFBiz with `--portoffset=10000` and a `WebSite` entity present for the ecommerce webapp (`webSiteId=WebStore`), logging the ports `WebSiteProperties.from(request)` actually computes:
| | httpPort | httpsPort |
|---|---|---|
| trunk | 28080 | 28443 |
| #949 | 28080 | **18443** |
| this PR | **18080** | **18443** |
With this change the secure redirect lands on `https://localhost:18443/…` and non-secure full-path URLs use `:18080`, both matching the actual offset listeners. Behaviour is unchanged when `portOffset` is `0` (the default).
Also verified with `./gradlew compileJava` and `./gradlew checkstyleMain`.
> Note for reviewers: a `WebSite` entity must exist for the affected `webSiteId` to reproduce this — with a seed-only DB everything falls back to the default path and the bug doesn't surface.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fixed: The port offset is being applied twice when loading WebSite properties (OFBIZ-13352) [ofbiz-framework]
Posted by "arunpati (via GitHub)" <gi...@apache.org>.
arunpati merged PR #1392:
URL: https://github.com/apache/ofbiz-framework/pull/1392
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org