Permalink
Browse files

Fix accept and null headers

  • Loading branch information...
1 parent ae7ac50 commit d9785eb0b4bbe46335ba111d59da57ac5020b134 @justinrocket justinrocket committed Sep 13, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/csharp/Plupload/FileReference.cs
@@ -206,8 +206,13 @@ public class FileReference {
// Add custom headers
if (this.headers != null) {
- foreach (string key in this.headers.Keys)
- req.Headers[key] = (string)this.headers[key];
+ foreach (string key in this.headers.Keys) {
+ if (key.Equals("accept", StringComparison.InvariantCultureIgnoreCase)) {
+ req.Accept = (string)this.headers[key];
+ } else if (this.headers[key] != null) {
+ req.Headers[key] = (string)this.headers[key];
+ }
+ }
}
IAsyncResult asyncResult = req.BeginGetRequestStream(new AsyncCallback(RequestStreamCallback), req);

0 comments on commit d9785eb

Please sign in to comment.