Skip to content

Commit

Permalink
Fixes #9698. Adds support for HEAD http requests.
Browse files Browse the repository at this point in the history
Patch supplied by Jim with slight modification by David Blain.
  • Loading branch information
jwestfall69 authored and dblain committed Mar 28, 2011
1 parent 8c18a32 commit aa2be4e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mythtv/libs/libmythupnp/servicehost.cpp
Expand Up @@ -35,7 +35,7 @@

MethodInfo::MethodInfo()
{
m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost);
m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost | RequestTypeHead);
}

//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -220,7 +220,7 @@ ServiceHost::ServiceHost( const QMetaObject &metaObject, const QString &sExtensi
oInfo.m_nMethodIndex = nIdx;
oInfo.m_sName = sName.section( '(', 0, 0 );
oInfo.m_oMethod = method;
oInfo.m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost);
oInfo.m_eRequestType = (RequestType)(RequestTypeGet | RequestTypePost | RequestTypeHead);

QString sMethodClassInfo = oInfo.m_sName + "_Method";

Expand All @@ -233,7 +233,7 @@ ServiceHost::ServiceHost( const QMetaObject &metaObject, const QString &sExtensi
if (sRequestType == "POST")
oInfo.m_eRequestType = RequestTypePost;
else if (sRequestType == "GET" )
oInfo.m_eRequestType = RequestTypeGet;
oInfo.m_eRequestType = (RequestType)(RequestTypeGet | RequestTypeHead);
}

m_Methods.insert( oInfo.m_sName, oInfo );
Expand Down Expand Up @@ -323,7 +323,8 @@ bool ServiceHost::ProcessRequest( HttpWorkerThread *pThread, HTTPRequest *pReque
else
{
switch( pRequest->m_eType )
{
{
case RequestTypeHead:
case RequestTypeGet : sMethodName = "Get" + sMethodName; break;
case RequestTypePost: sMethodName = "Put" + sMethodName; break;
}
Expand Down

0 comments on commit aa2be4e

Please sign in to comment.