{"action":"created","issue":{"url":"https://api.github.com/repos/node-nock/nock/issues/505","repository_url":"https://api.github.com/repos/node-nock/nock","labels_url":"https://api.github.com/repos/node-nock/nock/issues/505/labels{/name}","comments_url":"https://api.github.com/repos/node-nock/nock/issues/505/comments","events_url":"https://api.github.com/repos/node-nock/nock/issues/505/events","html_url":"https://github.com/node-nock/nock/issues/505","id":142326556,"number":505,"title":"nock appears to be setting text/html content-type...","user":{"login":"export-mike","id":2983327,"avatar_url":"https://avatars.githubusercontent.com/u/2983327?v=3","gravatar_id":"","url":"https://api.github.com/users/export-mike","html_url":"https://github.com/export-mike","followers_url":"https://api.github.com/users/export-mike/followers","following_url":"https://api.github.com/users/export-mike/following{/other_user}","gists_url":"https://api.github.com/users/export-mike/gists{/gist_id}","starred_url":"https://api.github.com/users/export-mike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/export-mike/subscriptions","organizations_url":"https://api.github.com/users/export-mike/orgs","repos_url":"https://api.github.com/users/export-mike/repos","events_url":"https://api.github.com/users/export-mike/events{/privacy}","received_events_url":"https://api.github.com/users/export-mike/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-21T11:57:36Z","updated_at":"2016-03-21T11:59:42Z","closed_at":null,"body":"I have the following test. my action triggers two requests via fetch. first one seems to work fine. second one seems to be getting content-type text/html?\r\n\r\n```javascript\r\nimport * as auth from '../auth';\r\nimport configureMockStore from 'redux-mock-store';\r\nimport nock from 'nock';\r\nimport {expect} from 'chai';\r\n\r\nconst mockStore = configureMockStore();\r\nGLOBAL.API_URL = 'http://sssssss.com';\r\nGLOBAL.AUTH_KEY = 'TeriyakiUser:9435e65f-9f80-4379-aff2-63a06be2test';\r\ndescribe('auth actions', () => {\r\n  afterEach(() => {\r\n    nock.cleanAll();\r\n  });\r\n\r\n  it('login', () => {\r\n    nock(API_URL)\r\n    .post('/Auth/core/connect/token')\r\n    .reply(200, {token_type: 'bearer', access_token: '12313123'})\r\n    \r\n    nock(API_URL)\r\n    .get('/Auth/core/connect/userinfo')\r\n    .reply(200, {token_type: 'bearer', access_token: '12313123'});\r\n\r\n    const expectedActions = [\r\n      {type: auth.AUTH.REQUEST, payload: { username: 'mike'}},\r\n      {type: auth.AUTH.SUCCESS, payload: {token: '12313123', tokenType: 'Bearer'}}\r\n    ];\r\n    const store = mockStore({token: null});\r\n    const {dispatch} = store;\r\n\r\n    auth.login({username: 'mike', password: 'pass123'})(dispatch);\r\n\r\n    expect(store.getActions()).to.eql(expectedActions);\r\n  });\r\n});\r\n```\r\n\r\nwhich calls my apiclient code which uses fetch.\r\nI'm using mocha for my testing and setting fetch globally to be -r isomorphic-fetch in my mocha.opts.\r\n\r\n```javascript\r\nlet authToken = SessionStorage.getItem('token'); // api client manages token key\r\nexport const login = (username, password) => {\r\n  return fetch(`${API_URL}/Auth/core/connect/token`, {\r\n    method: POST,\r\n    headers: {\r\n      'Authorization': `Basic ${btoa(AUTH_KEY)}`,\r\n      'Accept': 'application/json',\r\n      'Content-Type': 'application/x-www-form-urlencoded'\r\n    },\r\n    mode: 'cors',\r\n    body: qs.stringify({\r\n      grant_type: 'password',\r\n      username,\r\n      password,\r\n      scope: 'Teryaki profile openid'\r\n    })\r\n  })\r\n  .then(checkHttpStatus)\r\n  .then(parseJSON)\r\n  .then(camelCase)\r\n  .then(fetchClientDetails);\r\n};\r\n\r\nexport const fetchClientDetails = ({tokenType, accessToken, expiresIn}) => {\r\n  const token = accessToken;\r\n  const expiry = expiresIn;\r\n  authToken = `${tokenType} ${token}`;\r\n  return fetch(`${API_URL}/Auth/core/connect/userinfo`, {\r\n    method: 'GET',\r\n    headers: {\r\n      'Authorization': authToken,\r\n      'Accept': 'application/json',\r\n      'Content-Type': 'application/json'\r\n    }\r\n  })\r\n  .then((r) => {\r\n    console.log(r.headers.get('Content-Type')); // text/html\r\n    return r.json();}) // throws error error [SyntaxError: Unexpected token <]\r\n  .then(camelCase)\r\n  .then((clientDetails) => {\r\n    SessionStorage.setItem('token', authToken);\r\n    return Object.assign({}, clientDetails, {\r\n      token,\r\n      tokenType,\r\n      expiry\r\n    });\r\n  });\r\n};\r\n```\r\n\r\n\r\n\r\n\r\nany guidance would be very helpful thanks.\r\n"},"comment":{"url":"https://api.github.com/repos/node-nock/nock/issues/comments/199241417","html_url":"https://github.com/node-nock/nock/issues/505#issuecomment-199241417","issue_url":"https://api.github.com/repos/node-nock/nock/issues/505","id":199241417,"user":{"login":"export-mike","id":2983327,"avatar_url":"https://avatars.githubusercontent.com/u/2983327?v=3","gravatar_id":"","url":"https://api.github.com/users/export-mike","html_url":"https://github.com/export-mike","followers_url":"https://api.github.com/users/export-mike/followers","following_url":"https://api.github.com/users/export-mike/following{/other_user}","gists_url":"https://api.github.com/users/export-mike/gists{/gist_id}","starred_url":"https://api.github.com/users/export-mike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/export-mike/subscriptions","organizations_url":"https://api.github.com/users/export-mike/orgs","repos_url":"https://api.github.com/users/export-mike/repos","events_url":"https://api.github.com/users/export-mike/events{/privacy}","received_events_url":"https://api.github.com/users/export-mike/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T11:59:42Z","updated_at":"2016-03-21T11:59:42Z","body":"within fetchClientDetails the response headers are text/html\r\nsee: ``` console.log(r.headers.get('Content-Type')); // text/html\r\n    return r.json();}) // throws error error [SyntaxError: Unexpected token <]```"}}