Skip to content

Loading…

auto forwarding DELETE redirects #119

Closed
Raynos opened this Issue · 1 comment

2 participants

@Raynos

We seem to have blocks on PUT and POST here

https://github.com/mikeal/request/blob/master/main.js#L339

  if (response.statusCode >= 300 &&
      response.statusCode < 400  &&
      self.followRedirect     &&
      self.method !== 'PUT' &&
      self.method !== 'POST' &&
      response.headers.location

Should we also block self.method !== 'DELETE' ?

@mikeal
request member

good point.

the reason we block put and post is because it could be dangerous because the request carries write consequences. DELETE does as well so we should also block it.

@goatslacker goatslacker added a commit to goatslacker/request that referenced this issue
@goatslacker goatslacker Adds tests for GH-119 Fix a8db451
@goatslacker goatslacker added a commit to goatslacker/request that referenced this issue
@goatslacker goatslacker Adds tests for GH-119 Fix 0c0c201
@mikeal mikeal closed this in ccacfc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.