opensearch-project / opensearch-project/OpenSearch

Enable custom server response headers through opensearch.yml configuration

Open
#1,069 18 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

discuss enhancement lucene stalled
Dominant language
Java
Stars
13.7k
Forks
3k
Avg merge
2d 23h
Merged PRs (30d)
108

Description

The objective of this feature is to provide a configuration open in opensearch.yml to enable the server to send custom HTTP response headers.

The option can be defined as shown below:
http.custom.headers: ["Strict-Security-Transport:max-age=31536000; includeSubDomains;"]

Running this "curl -v -u admin:admin http://localhost:9200" command would return the below bold header in the HTTP response. (The below response is coming from Elasticsearch but the same is expected with OpenSearch)

  • Rebuilt URL to: http://localhost:9200/
  • Trying ::1...
  • TCP_NODELAY set
  • Connected to localhost (::1) port 9200 (#0)
  • Server auth using Basic with user 'admin'

GET / HTTP/1.1
Host: localhost:9200
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: curl/7.55.1
Accept: /

< HTTP/1.1 200 OK
< Strict-Security-Transport: max-age=31536000; includeSubDomains;
< content-type: application/json; charset=UTF-8
< content-length: 506
<
{
"name" : "LAPTOP-C0J5I3L2",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "xVUOVOAGR4iaNHA2AEv1pw",
"version" : {
"number" : "7.8.0",
"build_flavor" : "oss",
"build_type" : "zip",
"build_hash" : "unknown",
"build_date" : "2021-02-16T10:30:42.633581400Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating how OpenSearch reads opensearch.yml and how its HTTP server assembles responses; the issue does not name implementation files or tests. Use the provided curl command to verify that headers configured through http.custom.headers are returned in server responses, including the example Strict-Security-Transport header.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.