Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Fixed issue with missing headers in digest request.
Browse files Browse the repository at this point in the history
  • Loading branch information
fela98 committed May 20, 2017
1 parent d0ba899 commit 9c7786a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/net/digestcache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Dictionary } from "../collections/collections";
import { HttpClient } from "./httpclient";
import { Util } from "../utils/util";
import { ODataDefaultParser } from "../sharepoint/odata";
import { RuntimeConfig } from "../configuration/pnplibconfig";

export class CachedDigest {
public expiration: Date;
Expand All @@ -27,13 +28,15 @@ export class DigestCache {

const url = Util.combinePaths(webUrl, "/_api/contextinfo");

const headers = {
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose;charset=utf-8",
};

return this._httpClient.fetchRaw(url, {
cache: "no-cache",
credentials: "same-origin",
headers: {
"Accept": "application/json;odata=verbose",
"Content-type": "application/json;odata=verbose;charset=utf-8",
},
headers: Util.extend(headers, RuntimeConfig.headers, true),
method: "POST",
}).then((response) => {
const parser = new ODataDefaultParser();
Expand Down

0 comments on commit 9c7786a

Please sign in to comment.