Skip to content

Commit 61cffce

Browse files
committed
Fixed: modified the changelog briefly
1 parent 6337034 commit 61cffce

2 files changed

Lines changed: 21 additions & 75 deletions

File tree

v1/CHANGELOG.ko.md

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,23 @@
66

77
### v1 응답 URL 상대 경로화
88

9-
**v1** API 응답의 URL 필드를 **상대 경로** (`/...`) 로 변경했습니다. **v0 (레거시) 엔드포인트는 기존과 동일하게 절대 URL** (`http://{host}/...`) 을 반환합니다 — 기존 연동 시스템의 하위 호환성을 위해 유지됩니다.
9+
**v1** 응답의 URL 필드를 **상대 경로** (`/...`) 로 변경했습니다. **v0 엔드포인트는 절대 URL** (`http://{host}/...`) 을 유지합니다 (하위 호환).
1010

11-
영향 받는 v1 응답 필드 (REST·WebSocket):
12-
- `src``/wsapi/v1/export` 의 다운로드 링크
13-
- `videoSrc` — LPR / 검색 / 차량 추적 결과의 watch URL
14-
- `image`, `images[]` — 이벤트 알림, LPR / VA 검색 이미지 참조
15-
- `faceImg`, `orgImg` — 얼굴 검색 결과
11+
영향 필드: `src`, `videoSrc`, `image`, `images[]`, `faceImg`, `orgImg`.
1612

17-
```json
18-
// v1 응답
19-
{
20-
"download": [
21-
{"src": "/download/task-uuid/CH01.mp4", "fileName": "CH01.mp4"}
22-
]
23-
}
24-
25-
// v0 응답 (레거시 — 변경 없음)
26-
{
27-
"download": [
28-
{"src": "http://nvr.example.com/download/task-uuid/CH01.mp4", "fileName": "CH01.mp4"}
29-
]
30-
}
31-
```
32-
33-
v0 절대 URL의 host는 **Canonical Host** 서버 설정(웹 관리자 → 서버 설정 → API)이 지정되어 있으면 그 값을 사용하고, 없으면 요청의 `X-Host` 헤더로 fallback 합니다.
34-
35-
**클라이언트 호환성 (v1)**:
36-
- **브라우저 클라이언트**: 변경 불필요 — 상대 URL이 페이지 origin 에 자동 결합됩니다.
37-
- **비-브라우저 클라이언트** (curl, Python `requests`, 모바일 앱, 서버 간 통신): fetch 전 base URL 을 결합해야 합니다:
38-
```javascript
39-
const fullUrl = baseUrl + response.download[0].src;
40-
```
41-
42-
### 변경 배경
43-
44-
이전의 절대 URL 은 서버가 받은 `Host:` 헤더를 그대로 포함했습니다. 요청이 `Host:` 를 다시 쓰는 리버스 프록시를 통과하면 잘못된 호스트가 URL 에 박혀, 클라이언트가 다운로드에 실패하는 경우가 발생했습니다 (호스트 인젝션 패턴). v1 에서 상대 경로로 전환해 이 문제를 차단하고, 향후 다중 NVR 그룹 라우팅 아키텍처와 정렬했습니다. v0 는 기존 레거시 연동 시스템이 코드 수정 없이 동작하도록 절대 URL 을 유지합니다.
13+
**배경**: 기존 절대 URL 은 요청의 `Host:` 헤더를 그대로 사용해서, 리버스 프록시가 `Host:` 를 재작성하면 잘못된 호스트가 URL 에 박혔습니다. 향후 다중 NVR 그룹 라우팅과도 정렬됩니다.
4514

46-
### 라이브 스트림 URL 유지
15+
**클라이언트 호환성**:
16+
- 브라우저: 변경 불필요 — 상대 URL 이 페이지 origin 에 자동 결합됩니다.
17+
- 비-브라우저 (curl, 모바일, 서버 간 통신): fetch 전 base URL 을 결합해야 합니다.
4718

48-
`/api/v1/vod` (라이브 스트림) 응답 `src` 배열의 RTMP / WebSocket-FLV 스트림 URL 은 **절대 URL 유지** — 이 프로토콜들은 완전히 정규화된 URL 이 필요합니다.
19+
**예외**:
20+
- v0 절대 URL 의 host 는 **Canonical Host** (웹 관리자 → 서버 설정 → API) 값을 사용하고, 없으면 `X-Host` 헤더로 fallback.
21+
- `/api/v1/vod` 라이브 스트림 URL (RTMP / WebSocket-FLV) 은 절대 URL 유지.
4922

5023
### Breaking Changes
5124

52-
없음. v0 클라이언트는 기존과 동일하게 절대 URL 을 받습니다. 신규 v1 클라이언트는 상대 URL 을 받으므로 위 "클라이언트 호환성 (v1)" 항목 참고.
25+
없음.
5326

5427
---
5528

v1/CHANGELOG.md

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,25 @@
44

55
## v1.0.2
66

7-
### Relative URLs in v1 Response Bodies
7+
### Relative URLs in v1 Responses
88

9-
URL fields in **v1** API responses are returned as **relative paths** (e.g., `/download/...`) instead of absolute URLs. **v0 (legacy) endpoints continue to return absolute URLs** (`http://{host}/...`) for backward compatibility with existing integrations.
9+
URL fields in **v1** responses are now **relative paths** (`/...`). **v0 endpoints keep absolute URLs** (`http://{host}/...`) for backward compatibility.
1010

11-
Affected v1 response fields (REST and WebSocket):
12-
- `src` — download links from `/wsapi/v1/export`
13-
- `videoSrc` — watch URLs in LPR / find / vehicle tracking results
14-
- `image`, `images[]` — event notifications, LPR / VA search image references
15-
- `faceImg`, `orgImg` — face search results
11+
Affected v1 fields: `src`, `videoSrc`, `image`, `images[]`, `faceImg`, `orgImg`.
1612

17-
```json
18-
// v1 response
19-
{
20-
"download": [
21-
{"src": "/download/task-uuid/CH01.mp4", "fileName": "CH01.mp4"}
22-
]
23-
}
24-
25-
// v0 response (legacy — unchanged)
26-
{
27-
"download": [
28-
{"src": "http://nvr.example.com/download/task-uuid/CH01.mp4", "fileName": "CH01.mp4"}
29-
]
30-
}
31-
```
32-
33-
The host used for v0 absolute URLs comes from the **Canonical Host** server setting (Web Admin → Server Settings → API) when configured, otherwise falls back to the request's `X-Host` header.
34-
35-
**Client compatibility (v1)**:
36-
- **Browser clients**: no change required — relative URLs resolve against the page origin automatically.
37-
- **Non-browser clients** (curl, Python `requests`, mobile apps, server-to-server): prepend the API base URL when fetching:
38-
```javascript
39-
const fullUrl = baseUrl + response.download[0].src;
40-
```
41-
42-
### Why
43-
44-
Previous absolute URLs embedded the server's `Host:` header verbatim. When the request passed through a reverse proxy that rewrites `Host:`, the wrong hostname was baked into the URL — clients then failed to fetch the resource. Relative paths in v1 eliminate this class of issue and align with future federated multi-NVR group routing. v0 retains absolute URLs to keep existing legacy integrations working without code changes.
13+
**Why**: absolute URLs embedded the request's `Host:` header verbatim, so a reverse proxy rewriting `Host:` baked the wrong hostname into the URL. Relative paths also align with future multi-NVR group routing.
4514

46-
### Live Stream URLs Unchanged
15+
**Client compatibility**:
16+
- Browsers: no change — relative URLs resolve against the page origin.
17+
- Non-browser clients (curl, mobile, server-to-server): prepend the API base URL before fetching.
4718

48-
RTMP / WebSocket-FLV stream URLs in `src` arrays of `/api/v1/vod` (live stream) responses remain **absolute** — these protocols require fully-qualified URLs.
19+
**Exceptions**:
20+
- v0 absolute URL host comes from **Canonical Host** (Web Admin → Server Settings → API), falling back to the `X-Host` header.
21+
- `/api/v1/vod` live stream URLs (RTMP / WebSocket-FLV) remain absolute.
4922

5023
### Breaking Changes
5124

52-
None. v0 clients continue to receive absolute URLs as before. New v1 clients receive relative URLs — see "Client compatibility (v1)" above for guidance.
25+
None.
5326

5427
---
5528

0 commit comments

Comments
 (0)