Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Exit endpoint if an error is occured in request or proxy #233

Merged
merged 5 commits into from
May 20, 2021

Conversation

alex-schneider
Copy link
Contributor

@alex-schneider alex-schneider commented May 17, 2021

This pull request fixes sending a defined request within an endpoint regardless if a possible error occurred with a proxy or/and request definition.

server "api" {
  endpoint "/" {
    proxy {
      url = "https://..."
    }
    # or/and
    request "sidekick" {
      url = "https://..."
    }

    response {
      status = 200
      body = "some content"
    }
  }
}

Now the response with status 200 will not be written and the internal server error with status 500 will be served if something goes wrong with proxy or request e.g. a connection or timeout error. This does not apply to origin responses which sends a status 500 and Couper had no issues while sending the request and reading the response.

@malud malud merged commit 8a5edd4 into master May 20, 2021
@malud malud deleted the exit-endpoint-on-error branch May 20, 2021 16:04
filex pushed a commit that referenced this pull request May 21, 2021
proof that all actions after the error (set_response_headers…) will not
run
filex pushed a commit that referenced this pull request May 21, 2021
proof that all actions after the error (set_response_headers…) will not
run
malud pushed a commit that referenced this pull request May 21, 2021
proof that all actions after the error (set_response_headers…) will not
run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants