Skip to content

Conversation

@mcruzdev
Copy link
Contributor

Changes

  • Add a new RuntimeException the the serverlessworkflow-impl-http module called RedirectValidationException.
  • Add a new method into AbstractHttpExecutorBuilder responsible for applying redirect validation rules for the HTTP response. When the validation fails, it pass the response status code to the WorkflowError instance.

TODO

  • Add specific tests for redirect behavior (when the upstream server returns a 3XX status code)

Closes #959


if (!redirect) {
// disable automatic redirects handling from Jersey client
request.property("jersey.config.client.followRedirects", false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't tie our implementation to this client. Dowstream client code can override the HTTP client factory, hence it won't be Jersey.

We could have a supplier here where the downstream client can be called to react to this property instead.

By default, we set the jersey property or let the supplier from the underlying client do so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't tie our implementation to this client. Dowstream client code can override the HTTP client factory, hence it won't be Jersey.

Yeah, I forget this spec/impl detail.

We could have a supplier here where the downstream client can be called to react to this property instead.

Do you mean a new method WorkflowApplication.Builder method or a ServiceProvider?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot have the client factory in WorkflowApplication.Builder, we need to specify it as additional object. This implies heavy changes here and will affect current users. So lets keep it for a different PR (that will also deal with timeouts), in this one you do not need to do anything.

Copy link
Contributor Author

@mcruzdev mcruzdev Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will remove the jersey config.

@fjtirado
Copy link
Collaborator

@mcruzdev
For the PATCH thing I agree with Ricardo, let the implementation as it was, if the client does not support patch, so be it.
Regarding redirect configuration, I need to think, lets take some time to consider the alternatives.

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@mcruzdev mcruzdev marked this pull request as ready for review December 1, 2025 19:28
Copy link
Collaborator

@fjtirado fjtirado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mcruzdev

@fjtirado fjtirado merged commit f77cac6 into serverlessworkflow:main Dec 2, 2025
3 checks passed
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.

Add redirect for OpenAPI call

3 participants