# Query String Handling

## Default Query String 사용하기

사용자는 Low-Latency HLS  (또는 HLS)의 기본 동작 방식을 `<DefaultQueryString>`을 통해 제어 할 수 있습니다.

다음과 같이 `Server.xml`의 `<Publishers><LLHLS><DefaultQueryString>` (또는 `<Publishers><HLS><DefaultQueryString>)`에서 설정 할 수 있습니다:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Server version="8">
  ...
  <VirtualHosts>
    <VirtualHost>
      <Applications>
        <Application>
          <Publishers>
            ...
            <LLHLS>
              <DefaultQueryString>
                <Query>
                  <Key>_HLS_legacy</Key>
                  <Value>NO</Value>
                </Query>
                <Query>
                  <Key>_HLS_rewind</Key>
                  <Value>YES</Value>
                </Query>
              </DefaultQueryString>
            </LLHLS>
            ...
          </Publishers>
       </Application>
      </Applications>
    </VirtualHost>
  </VirtualHosts>
  ...
</Server>
```

{% hint style="info" %}
Playback URL에 이미 Query 문자열이 추가 되어 있는 경우 이 설정은 무시됩니다.
{% endhint %}

<table><thead><tr><th width="151">Key</th><th width="138">Value</th><th>Description</th></tr></thead><tbody><tr><td>_HLS_legacy</td><td>YES | NO <br><mark style="color:yellow;">* Default: NO</mark></td><td><code>_HLS_legacy</code> 값을 <code>YES</code>로 설정하면, LL-HLS Playlist 내에 Partial  Segment 정보를 제거하여 Legacy HLS (HLSv6 등)와 동일하게 동작합니다.<br><mark style="color:orange;">* LL-HLS Only</mark></td></tr><tr><td>_HLS_rewind</td><td>YES | NO<br><mark style="color:yellow;">* Default: YES</mark></td><td><code>_HLS_rewind</code> 값이 <code>YES</code>로 설정되어 있고 <a href="https://airensoft.gitbook.io/ovenmediaengine/streaming/low-latency-hls#live-rewind">Live Rewind</a> 기능이 활성화 된 경우, Playlist 내에 이전 Segment 정보가 포함됩니다.</td></tr></tbody></table>

## Query String 승계하기

사용자가 `<PropagateQueryString>` 을 활성화하면, 최초 Master Playlist 요청에 포함된 Query String이 하위 모든 요청 (Media Playlist, Segment, Partial Segment)에 자동으로 포함됩니다. Query String에 Session Key, Authentication Token 등을 포함시켜 이 기능을 활용한다면, 모든 요청을 CDN에서 검사할 수 있기 때문에 콘텐츠 접근 제어가 용이합니다.

다음과 같이 `Server.xml`의 `<Publishers><LLHLS><PropagateQueryString>` (또는 `<Publishers><HLS><PropagateQueryString>)`에서 설정 할 수 있습니다:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Server version="8">
  ...
  <VirtualHosts>
    <VirtualHost>
      <Applications>
        <Application>
          <Publishers>
            ...
            <LLHLS>
              <OriginMode>true</OriginMode>
              <PropagateQueryString>true</PropagateQueryString>
            </LLHLS>
            ...
          </Publishers>
        </Application>
      </Applications>
    </VirtualHost>
  </VirtualHosts>
  ...
</Server>
```

{% hint style="danger" %}
Query String에 민감한 정보를 직접 포함시키지 않도록 주의가 필요합니다.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ovenmediaengine-enterprise.gitbook.io/guide/ko-kr/features/workflow-integration-and-external-system-connectivity/query-string-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
