MapServer / MapServer-import

3 stars 2 forks source link

[OWS] is port 80 really needed on URLs? #1075

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: tomkralidis Date: 2004/11/19 - 00:22

Hi,

In mapows.c, function msOWSGetOnlineResource, if ows_onlineresource is not set,
one is set automagically.  Part of this includes tacking on the HTTP environment
variable SERVER_PORT to the URL.

While I see the rationale for this, do we need to tack on the port number if
it's port 80?  Perhaps if SERVER_PORT == 80, then don't tack on at all?
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/11/19 - 03:56

Wow! The software must be in real good shape if you're down reporting this kind
of aesthetic details as bugs.  ;)  

More seriously: is this really causing a problem anywhere?
tbonfort commented 12 years ago

Author: tomkralidis Date: 2004/11/19 - 04:36


I knew this one would get this type of response :)

It's not causing any problems.  Perhaps better filed as an enhancement, just
from the point of view of why put extra info when it's not necessarily needed.
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/11/19 - 23:49

Let's do it in 4.6... it's easy, but why take risks just before a release.
tbonfort commented 12 years ago

Author: tomkralidis Date: 2004/12/21 - 02:44


Putting this change at line 418 of mapows.c does the trick:

if (online_resource)
{
  if (strcmp(port,"80") == 0) {
    sprintf(online_resource, "%s://%s%s?", protocol, hostname, script);
}
  else {
    sprintf(online_resource, "%s://%s:%s%s?", protocol, hostname, port, script);
  }

.....
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/12/21 - 17:04

I have committed a fix for this in v4.5 (CVS)... my fix verifies that protocol
is http and port is 80, and does the same for https/443.