From dfcf3293e5474c42a51de25a1b7859a42672dd2d Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 16 Jun 2008 09:25:31 +0000 Subject: [PATCH] --- src/juce_core/io/network/juce_URL.cpp | 14 +++++++++++--- src/juce_core/io/network/juce_URL.h | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/juce_core/io/network/juce_URL.cpp b/src/juce_core/io/network/juce_URL.cpp index 0737e653e4..a87c617882 100644 --- a/src/juce_core/io/network/juce_URL.cpp +++ b/src/juce_core/io/network/juce_URL.cpp @@ -177,7 +177,8 @@ public: WebInputStream (const URL& url, const bool isPost_, URL::OpenStreamProgressCallback* const progressCallback_, - void* const progressCallbackContext_) + void* const progressCallbackContext_, + const String& extraHeaders) : position (0), finished (false), isPost (isPost_), @@ -189,6 +190,11 @@ public: if (isPost_) createHeadersAndPostData (url); + headers += extraHeaders; + + if (! headers.endsWithChar (T('\n'))) + headers << "\r\n"; + handle = juce_openInternetFile (server, headers, postData, isPost, progressCallback_, progressCallbackContext_); } @@ -363,10 +369,12 @@ private: InputStream* URL::createInputStream (const bool usePostCommand, OpenStreamProgressCallback* const progressCallback, - void* const progressCallbackContext) const + void* const progressCallbackContext, + const String& extraHeaders) const { WebInputStream* wi = new WebInputStream (*this, usePostCommand, - progressCallback, progressCallbackContext); + progressCallback, progressCallbackContext, + extraHeaders); if (wi->isError()) { diff --git a/src/juce_core/io/network/juce_URL.h b/src/juce_core/io/network/juce_URL.h index e3ab30cc92..0fbc2998b9 100644 --- a/src/juce_core/io/network/juce_URL.h +++ b/src/juce_core/io/network/juce_URL.h @@ -162,7 +162,8 @@ public: */ InputStream* createInputStream (const bool usePostCommand, OpenStreamProgressCallback* const progressCallback = 0, - void* const progressCallbackContext = 0) const; + void* const progressCallbackContext = 0, + const String& extraHeaders = String::empty) const; //==============================================================================