Skip to content

Commit c5465ca

Browse files
committed
closes gautamsi#320, allow access to http response headers
1 parent e37269b commit c5465ca

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

src/js/Core/ExchangeServiceBase.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -753,24 +753,24 @@ export abstract class ExchangeServiceBase {
753753
//todo: implement tracing
754754
this.TraceHttpResponseHeaders(traceType, response);
755755

756-
this.SaveHttpResponseHeaders(response.getAllResponseHeaders());
756+
this.SaveHttpResponseHeaders(response);
757757
}
758758

759759
/**
760760
* Save the HTTP response headers.
761761
*
762-
* @param {Object} headers The response headers
762+
* @param {Object} response The response headers
763763
*/
764-
private SaveHttpResponseHeaders(headers: any/* System.Net.WebHeaderCollection*/): any {
764+
private SaveHttpResponseHeaders(response: any/* System.Net.WebHeaderCollection*/): any {
765765
//debug:
766766
this.httpResponseHeaders.clear();
767767

768-
for (var key in headers.headers) {
769-
this.httpResponseHeaders.Add(key, headers.headers[key]);
768+
for (var key in response.headers || {}) {
769+
this.httpResponseHeaders.Add(key, response.headers[key]);
770770
}
771771

772772
if (this.OnResponseHeadersCaptured != null) {
773-
this.OnResponseHeadersCaptured(headers);
773+
this.OnResponseHeadersCaptured(this.httpResponseHeaders);
774774
}
775775
}
776776

src/js/Misc/DelegateTypes.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import {ItemAttachment} from "../ComplexProperties/ItemAttachment";
2-
import {ExchangeVersion} from "../Enumerations/ExchangeVersion";
3-
import {PropertyDefinition} from "../PropertyDefinitions/PropertyDefinition";
4-
import {ComplexProperty} from "../ComplexProperties/ComplexProperty";
5-
import {ExchangeService} from "../Core/ExchangeService";
6-
import {ServiceObject} from "../Core/ServiceObjects/ServiceObject";
1+
import { ItemAttachment } from "../ComplexProperties/ItemAttachment";
2+
import { ExchangeVersion } from "../Enumerations/ExchangeVersion";
3+
import { PropertyDefinition } from "../PropertyDefinitions/PropertyDefinition";
4+
import { ComplexProperty } from "../ComplexProperties/ComplexProperty";
5+
import { ExchangeService } from "../Core/ExchangeService";
6+
import { ServiceObject } from "../Core/ServiceObjects/ServiceObject";
7+
import { Dictionary } from "../AltDictionary";
78

89

910
//no change needed
@@ -25,7 +26,7 @@ export interface CustomXmlSerializationDelegate {
2526
//}
2627

2728
export interface ResponseHeadersCapturedHandler {
28-
(responseHeaders: any /*System.Net.WebHeaderCollection*/): void;
29+
(responseHeaders: Dictionary<string, string>): void;
2930
}
3031
//class ResponseHeadersCapturedHandler extends System.MulticastDelegate {
3132
// //BeginInvoke(responseHeaders: System.Net.WebHeaderCollection, callback: System.AsyncCallback, object: any): System.IAsyncResult{ throw new Error("DelegateTypes.ts - BeginInvoke : Not implemented.");}
@@ -66,17 +67,17 @@ export interface GetPropertyDefinitionCallback {
6667
export interface CreateComplexPropertyDelegate<TComplexProperty extends ComplexProperty> {
6768
(): TComplexProperty;
6869
}
69-
//class GetPropertyDefinitionCallback extends System.MulticastDelegate {
70-
// //BeginInvoke(version: ExchangeVersion, callback: System.AsyncCallback, object: any): System.IAsyncResult{ throw new Error("DelegateTypes.ts - BeginInvoke : Not implemented.");}
71-
// //EndInvoke(result: System.IAsyncResult): PropertyDefinition{ throw new Error("DelegateTypes.ts - EndInvoke : Not implemented.");}
72-
// //Invoke(version: ExchangeVersion): PropertyDefinition{ throw new Error("DelegateTypes.ts - Invoke : Not implemented.");}
73-
//}
70+
//class GetPropertyDefinitionCallback extends System.MulticastDelegate {
71+
// //BeginInvoke(version: ExchangeVersion, callback: System.AsyncCallback, object: any): System.IAsyncResult{ throw new Error("DelegateTypes.ts - BeginInvoke : Not implemented.");}
72+
// //EndInvoke(result: System.IAsyncResult): PropertyDefinition{ throw new Error("DelegateTypes.ts - EndInvoke : Not implemented.");}
73+
// //Invoke(version: ExchangeVersion): PropertyDefinition{ throw new Error("DelegateTypes.ts - Invoke : Not implemented.");}
74+
//}
7475

75-
//class CreateComplexPropertyDelegate<TComplexProperty> extends System.MulticastDelegate {
76-
// //BeginInvoke(callback: System.AsyncCallback, object: any): System.IAsyncResult{ throw new Error("DelegateTypes.ts - BeginInvoke : Not implemented.");}
77-
// //EndInvoke(result: System.IAsyncResult): TComplexProperty{ throw new Error("DelegateTypes.ts - EndInvoke : Not implemented.");}
78-
// //Invoke(): TComplexProperty{ throw new Error("DelegateTypes.ts - Invoke : Not implemented.");}
79-
//}
76+
//class CreateComplexPropertyDelegate<TComplexProperty> extends System.MulticastDelegate {
77+
// //BeginInvoke(callback: System.AsyncCallback, object: any): System.IAsyncResult{ throw new Error("DelegateTypes.ts - BeginInvoke : Not implemented.");}
78+
// //EndInvoke(result: System.IAsyncResult): TComplexProperty{ throw new Error("DelegateTypes.ts - EndInvoke : Not implemented.");}
79+
// //Invoke(): TComplexProperty{ throw new Error("DelegateTypes.ts - Invoke : Not implemented.");}
80+
//}
8081

8182

8283
export interface CreateServiceObjectWithServiceParam {

0 commit comments

Comments
 (0)