jenkinsci / jenkinsci/urltrigger-plugin

Trigger based on HTTP response header value

Open
#39 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17
Forks
44
PR merge metrics
No merged PRs in 30d

Description

### Feature Request

It would be nice if you could trigger based on an http response header value, similar to the TextContent regex matching.

For example

```
> http options https://xxx
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: X-Requested-With,Content-Type,Authorization
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Encoding: gzip
Content-Security-Policy: frame-ancestors 'none'
Date: Thu, 13 May 2021 18:27:38 GMT
Keep-Alive: timeout=5
My-Header: value
```

When the `my-header` header value changes, trigger.

The use for this, in my case, is checking if a version of a service (eg: an api) has changed, and queuing a test job against it. Ideally you could have control over the HTTP method, but at least the status code should be able to be ignored while still checking the header (eg: the api endpoint is a POST and returns an error code, but also the header still).

I'm happy to branch and submit this as a PR, but I would need some basic direction as to where something like that would fit into the current code. There's checking already for some specific header values (etag, last-modified) that _looks_ like it would be a pattern to follow.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.