Releases: DevNewbie1826/webUtil
Release v0.4.3
종속성 업데이트
Release v0.4.2
This reverts commit 5048be4.
Release v0.4.1
http.ServeFile을 사용하는 최적화 경로는 gzip 핸들러와 같은 미들웨어와 충돌하여 무한 로딩 문제를 일으킬 수 있으므로 제거되었습니다.
이제 모든 요청은 미들웨어 호환성을 보장하기 위해 표준 http.FileServer를 통해 처리됩니다.
Release v0.4.0
- 성능 최적화 (Performance Optimization)
Sendfile적용: 로컬 디렉토리(http.Dir)를 서빙할 때 http.ServeFile을 사용하도록 로직을 개선했습니다. 이를 통해 OS 레벨의 sendfile 시스템 콜을 활용하여 파일 전송 성능이 대폭
향상되었습니다.
- 동작 방식 변경 (Behavior Changes)
- 디렉토리 접근 제한 강화: 기존에는 디렉토리 경로로 접근 시 index.html이 있으면 서빙했으나, 이제는 보안 및 명확성을 위해 폴더 경로로 접근하는 즉시
403 Forbidden(권한 없음) 오류를
반환하도록 변경되었습니다.- 파일이 존재하지 않는 경우에는 기존대로 404 Not Found를 반환합니다.
Release v0.3.0
🚀 Performance Improvements
- Memory Allocation Optimization: Reduced memory allocations in
cryptoRandNonceby up to 90% compared to v0.2.0. Replaced streaming I/O and base64 encoder usage with direct encoding using pre-allocated buffers, eliminating heap allocations for small nonce sizes. - Nonce Size Adjustment: Updated default nonce size from 24 bytes to 16 bytes (128 bits) to align with CSP standards while improving performance. This results in approximately 30% memory savings and 4% speed improvement in benchmarks.
- Code Refactoring: Introduced
NonceSizeconstant for better maintainability, removing hardcoded values and simplifying function signatures.
🚀 성능 개선
- 메모리 할당 최적화: v0.2.0에 비해
cryptoRandNonce에서 메모리 할당을 최대 90% 감소. 스트리밍 I/O와 base64 인코더 사용을 사전 할당 버퍼를 사용한 직접 인코딩으로 대체하여 작은 nonce 크기의 힙 할당을 제거. - Nonce 크기 조정: CSP 표준에 맞춰 기본 nonce 크기를 24바이트에서 16바이트(128비트)로 업데이트하여 성능 향상. 벤치마크에서 약 30% 메모리 절약과 4% 속도 개선.
- 코드 리팩토링: 유지보수성을 위해
NonceSize상수를 도입, 하드코딩 값 제거 및 함수 시그니처 단순화.
Release v0.2.0
webUtil v0.2.0 Release Notes
This release introduces a major overhaul of the fileserver package, making it more secure,
feature-rich, and aligned with Go's standard library best practices. It also includes the official
addition of an MIT license.
-
The function signature for fileserver.Run has been changed to support configurable caching. The
variadic stripPrefix ...string parameter has been replaced with explicit parameters.Before: func Run(r *chi.Mux, urlPath string, fs http.FileSystem, stripPrefix ...string)
After: func Run(r *chi.Mux, urlPath string, fs http.FileSystem, stripPrefix string, cacheMaxAgeSeconds int)
✨ New Features
fileserverPackage Overhaul:- Completely refactored to use the standard http.FileServer and http.StripPrefix for improved
security and efficiency. - Configurable Caching: You can now control the Cache-Control header via the new
cacheMaxAgeSeconds parameter in fileserver.Run. - Custom 404 Handling: The file server now uses the httperror library for 404 responses,
ensuring consistent error handling across the application. - Automatic
index.htmlServing: Requests to a directory (e.g., /static/) will now
automatically serve the index.html file within that directory if it exists.
- Completely refactored to use the standard http.FileServer and http.StripPrefix for improved
🚀 Improvements
- Security: Directory listing is now disabled by default in the fileserver to prevent exposing the
file structure. - Code Readability: Added detailed English and Korean comments to the fileserver package to improve
maintainability.
📝 Documentation
- Added a new section and a complete usage example for the fileserver package in README.md.
- Updated the features list in README.md to include the new file server.
🧹 Chores
- Added an MIT LICENSE file to the project root.
- Added a "License" section to README.md.
webUtil v0.2.0 릴리즈 노트
이번 릴리즈는 fileserver 패키지의 대대적인 개편을 통해 보안과 기능을 강화하고, Go 표준 라이브러리
모범 사례에 맞게 개선했습니다. 또한, MIT 라이선스를 공식적으로 추가했습니다.
-
캐시 설정을 지원하기 위해 fileserver.Run 함수의 시그니처가 변경되었습니다. 가변 인자였던
stripPrefix ...string 파라미터가 명시적인 파라미터로 대체되었습니다.변경 전: func Run(r *chi.Mux, urlPath string, fs http.FileSystem, stripPrefix ...string)
변경 후: func Run(r *chi.Mux, urlPath string, fs http.FileSystem, stripPrefix string, cacheMaxAgeSeconds int)
✨ 새로운 기능
fileserver패키지 개편:- 보안과 효율성을 높이기 위해 표준 라이브러리인 http.FileServer와 http.StripPrefix를 사용하도록
완전히 리팩토링했습니다. - 캐시 설정 기능: 이제 fileserver.Run 함수의 새로운 cacheMaxAgeSeconds 파라미터를 통해
Cache-Control 헤더를 직접 제어할 수 있습니다. - 커스텀 404 처리: 파일 서버가 404 응답에 httperror 라이브러리를 사용하도록 하여, 애플리케이션
전반에 걸쳐 일관된 오류 처리를 보장합니다. - 자동
index.html제공: 디렉토리(예: /static/) 요청 시, 해당 디렉토리 내에 index.html 파일이
존재하면 자동으로 제공합니다.
- 보안과 효율성을 높이기 위해 표준 라이브러리인 http.FileServer와 http.StripPrefix를 사용하도록
🚀 개선 사항
- 보안: fileserver에서 파일 구조 노출을 방지하기 위해 디렉토리 리스팅을 기본적으로 비활성화했습니다.
- 코드 가독성: 유지보수성 향상을 위해 fileserver 패키지에 상세한 영문 및 한글 주석을 추가했습니다.
📝 문서
- README.md 파일에 fileserver 패키지에 대한 새로운 섹션과 전체 사용 예제를 추가했습니다.
- README.md의 기능 목록에 새로운 파일 서버를 포함하도록 업데이트했습니다.
🧹 기타 작업
- 프로젝트 루트에 MIT 라이선스 파일(LICENSE)을 추가했습니다.
- README.md에 "라이선스" 섹션을 추가했습니다.
Initial Release
This is the initial release of webUtil, a collection of useful Go utilities and middleware for web
development.
✨ New Features
secureMiddleware: A robust middleware to easily apply security-related HTTP headers to your
application.- Supports Content-Security-Policy, X-Frame-Options, HSTS, X-XSS-Protection, and more for
enhanced security. - Highly configurable to fit various security requirements.
- Supports Content-Security-Policy, X-Frame-Options, HSTS, X-XSS-Protection, and more for
compressMiddleware: Middleware to compress HTTP responses on the fly using Gzip or Deflate,
helping to reduce bandwidth usage and improve loading speed.cookieHelpers: Simple and convenient functions to get and set cookies (SetCookie, GetCookie) in
http.Request and http.ResponseWriter.
한국어
버전: v0.1.0
제목: 첫 릴리즈
webUtil의 첫 번째 릴리즈입니다. webUtil은 Go 언어를 사용한 웹 개발에 유용한 유틸리티 및 미들웨어
모음입니다.
✨ 새로운 기능
secure미들웨어: 보안 관련 HTTP 헤더를 애플리케이션에 쉽게 적용할 수 있는 강력한 미들웨어입니다.- Content-Security-Policy, X-Frame-Options, HSTS, X-XSS-Protection 등 향상된 보안을 위한 다양한
옵션을 지원합니다. - 다양한 보안 요구사항에 맞춰 세부 설정이 가능합니다.
- Content-Security-Policy, X-Frame-Options, HSTS, X-XSS-Protection 등 향상된 보안을 위한 다양한
compress미들웨어: Gzip 또는 Deflate 알고리즘을 사용하여 HTTP 응답을 실시간으로 압축합니다. 이를
통해 대역폭 사용량을 줄이고 로딩 속도를 개선할 수 있습니다.cookie헬퍼: http.Request와 http.ResponseWriter에서 쿠키를 쉽게 설정하고 가져올 수 있는 편리한
함수(SetCookie, GetCookie)를 제공합니다.