From: <[EMAIL PROTECTED]>


Handle GetProtocol correctly (and consistant with ASP.NET conventions.)

A very, very good idea! :)


virtual String* GetProtocol(void)

<quote>

When overridden in a derived
class, returns the HTTP protocol
(HTTP or HTTPS).

</quote>

.NET Framework Class Library
HttpWorkerRequest.GetProtocol Method
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebHttpWorkerRequestClassGetProtocolTopic.asp

        {
-            // TODO: HTTPS when appropriate
+#if MODULE_MAGIC_NUMBER_MAJOR >= 20050101
+            // Fixes in httpd-2.1-dev
+            const char __nogc *method = ap_http_scheme(rr);
+#else
+            const char __nogc *method = ap_http_method(rr);
+#endif

Seems to me, that some other developers are the ones who cannot make up their minds, as to just what "all this" really means. :)

+ String *scheme(method);

Really confusing me now, and using only three words. :)

+
+            // For some silly reason, the ASP.NET team thought that
schemes
+            // are upper case entities;

I disagree with your reading of most of the .NET documentation.

Protocol when used in most tech
papers today, is usually always
upper cased.

<quote>

In information technology,
a protocol (pronounced PROH-tuh-cahl,
from the Greek protocollon,
which was a leaf of paper
glued to a manuscript volume,
describing its contents) is
the special set of rules that
end points in a telecommunication
connection use when they communicate.

</quote>

protocol
http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci212839,00.html

Notice in the above link
that the usage for all
"named" protocols
is always upper cased.

Also see the
Protocol Directory
Index of WAN, LAN, and
ATM Protocols
http://www.protocols.com/pbook/index.htm


+            scheme = scheme->ToUpper(nullCulture);
#ifdef _DEBUG
-            LogRequestError(L"GetProtocol: returns HTTP",
APLOG_DEBUG, 0);
+            String *schemeMsg = String::Concat(L"GetProtocol:
returns ", scheme);
+            LogRequestError(schemeMsg, APLOG_DEBUG, 0);
#endif
-            return new String(L"HTTP");
+            return scheme;
        }


<quote>

A string containing the
scheme of the specified URI.

</quote>

.NET Framework Class Library
Uri.Scheme Property
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemUriClassSchemeTopic.asp

Now please try the sample
included with the above
link (about URI/Scheme)
but use all uppercase chars.

For example:

newUri("http://www

change to

new Uri("HTTP://www

What do you get back?

Notice the below:

<quote>

Provides an object representation
of a uniform resource identifier
(URI) and easy access to the parts
of the URI.

SNIP

To put the URI in canonical form,
the Uri constructor performs the
following steps.

Converts the URI scheme to lower case.
Converts the host name to lower case.

</quote>

.NET Framework Class Library
Uri Class
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemUriClassTopic.asp

I believe your source code comment

<quote>

+
+            // For some silly reason, the ASP.NET team thought that
schemes
+            // are upper case entities;

</quote>

should be removed.

If you disagree with me, please
provide some sort of "other"
information (.NET docs, links,
and etc.) with your reply.


Jeff





Reply via email to