Browse Source

tags/2021-05-28
jules 17 years ago
parent
commit
dfcf3293e5
2 changed files with 13 additions and 4 deletions
  1. +11
    -3
      src/juce_core/io/network/juce_URL.cpp
  2. +2
    -1
      src/juce_core/io/network/juce_URL.h

+ 11
- 3
src/juce_core/io/network/juce_URL.cpp View File

@@ -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())
{


+ 2
- 1
src/juce_core/io/network/juce_URL.h View File

@@ -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;
//==============================================================================


Loading…
Cancel
Save