Skip to content

create plugin for set default headers #48

Open
pavelpower opened this issue Jun 9, 2020 · 0 comments
Open

create plugin for set default headers #48

pavelpower opened this issue Jun 9, 2020 · 0 comments

Comments

@pavelpower
Copy link

const defaultHeaders = defaultHeadersVal => ({
  init(context, next) {
    const { headers = {} } = context.state.request;
    context.state.request.headers = {
      ...defaultHeadersVal,
      ...headers,
    };
    next();
  },
});
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant