diff --git a/HISTORY.md b/HISTORY.md index f9c5331c..c3216d7a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -17,6 +17,10 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene **How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris` or let the automatic updater do that for you. +# Th, 15 February 2018 | v10.2.1 + +Fix subdomains' `StaticEmbedded` & `StaticWeb` not found errors, as reported by [@speedwheel](https://github.com/speedwheel) via [facebook page's chat](https://facebook.com/iris.framework). + # Th, 08 February 2018 | v10.2.0 A new minor version family because it contains a **BREAKING CHANGE** and a new `Party#Reset` function. diff --git a/HISTORY_GR.md b/HISTORY_GR.md index 52a6f5bd..ca3e398a 100644 --- a/HISTORY_GR.md +++ b/HISTORY_GR.md @@ -17,6 +17,12 @@ **Πώς να αναβαθμίσετε**: Ανοίξτε την γραμμή εντολών σας και εκτελέστε αυτήν την εντολή: `go get -u github.com/kataras/iris` ή αφήστε το αυτόματο updater να το κάνει αυτό για σας. +# Th, 15 February 2018 | v10.2.1 + +Διόρθωση το οποίο αφορά 404 not found errors στα αρχεία που σερβίρονται από τα `StaticEmbedded` και `StaticWeb` των υποτομεών(subdomains), όπως αναφέρθηκε πριν λίγο από τον [@speedwheel](https://github.com/speedwheel) μέσω [της σελίδας μας στο facebook](https://facebook.com/iris.framework). + +This history entry is not yet translated to Greek. Please read [the english version instead](https://github.com/kataras/iris/blob/master/HISTORY.md#th-15-february-2018--v1021). + # Th, 08 February 2018 | v10.2.0 This history entry is not yet translated to Greek. Please read [the english version instead](https://github.com/kataras/iris/blob/master/HISTORY.md#th-08-february-2018--v1020). diff --git a/HISTORY_ZH.md b/HISTORY_ZH.md index 1888e196..f65e0c34 100644 --- a/HISTORY_ZH.md +++ b/HISTORY_ZH.md @@ -17,6 +17,10 @@ **如何升级**: 打开命令行执行以下命令: `go get -u github.com/kataras/iris` 或者等待自动更新。 +# Th, 15 February 2018 | v10.2.1 + +This history entry is not yet translated to Chinese. Please read [the english version instead](https://github.com/kataras/iris/blob/master/HISTORY.md#th-15-february-2018--v1021). + # 2018 2月8号 | v10.2.0 版本更新 新的小版本, 因为它包含一个 **破坏性变动** 和一个新功能 `Party#Reset` diff --git a/README.md b/README.md index 9cf356f5..096c1e6d 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ _Updated at: [Tuesday, 21 November 2017](_benchmarks/README_UNIX.md)_ ## Support -- [HISTORY](HISTORY.md#th-08-february-2018--v1020) file is your best friend, it contains information about the latest features and changes +- [HISTORY](HISTORY.md#th-15-february-2018--v1021) file is your best friend, it contains information about the latest features and changes - Did you happen to find a bug? Post it at [github issues](https://github.com/kataras/iris/issues) - Do you have any questions or need to speak with someone experienced to solve a problem at real-time? Join us to the [community chat](https://chat.iris-go.com) - Complete our form-based user experience report by clicking [here](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/README_GR.md b/README_GR.md index fb6a7f68..f9277217 100644 --- a/README_GR.md +++ b/README_GR.md @@ -108,7 +108,7 @@ _Η τελευταία ενημέρωση έγινε την [Τρίτη, 21 Νο ## Υποστήριξη -- To [HISTORY](HISTORY_GR.md#th-08-february-2018--v1020) αρχείο είναι ο καλύτερος σας φίλος, περιέχει πληροφορίες σχετικά με τις τελευταίες λειτουργίες(features) και αλλαγές +- To [HISTORY](HISTORY_GR.md#th-15-february-2018--v1021) αρχείο είναι ο καλύτερος σας φίλος, περιέχει πληροφορίες σχετικά με τις τελευταίες λειτουργίες(features) και αλλαγές - Μήπως τυχαίνει να βρήκατε κάποιο bug; Δημοσιεύστε το στα [github issues](https://github.com/kataras/iris/issues) - Έχετε οποιεσδήποτε ερωτήσεις ή πρέπει να μιλήσετε με κάποιον έμπειρο για την επίλυση ενός προβλήματος σε πραγματικό χρόνο; Ελάτε μαζί μας στην [συνομιλία κοινότητας](https://chat.iris-go.com) - Συμπληρώστε την αναφορά εμπειρίας χρήστη κάνοντας κλικ [εδώ](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/README_RU.md b/README_RU.md index e7eae61d..aaa29ad4 100644 --- a/README_RU.md +++ b/README_RU.md @@ -106,7 +106,7 @@ _Обновлено: [Вторник, 21 ноября 2017 г.](_benchmarks/READ ## Поддержка -- Файл [HISTORY](HISTORY.md#th-08-february-2018--v1020) - ваш лучший друг, он содержит информацию о последних особенностях и всех изменениях +- Файл [HISTORY](HISTORY.md#th-15-february-2018--v1021) - ваш лучший друг, он содержит информацию о последних особенностях и всех изменениях - Вы случайно обнаружили ошибку? Опубликуйте ее на [Github вопросы](https://github.com/kataras/iris/issues) - У Вас есть какие-либо вопросы или Вам нужно поговорить с кем-то, кто бы смог решить Вашу проблему в режиме реального времени? Присоединяйтесь к нам в [чате сообщества](https://chat.iris-go.com) - Заполните наш отчет о пользовательском опыте на основе формы, нажав [здесь](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/README_ZH.md b/README_ZH.md index 43952d41..cebf49ae 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -102,7 +102,7 @@ _更新于: [2017年11月21日星期二](_benchmarks/README_UNIX.md)_ ## 支持 -- [更新记录](HISTORY_ZH.md#th-08-february-2018--v1020) 是您最好的朋友,它包含有关最新功能和更改的信息 +- [更新记录](HISTORY_ZH.md#th-15-february-2018--v1021) 是您最好的朋友,它包含有关最新功能和更改的信息 - 你碰巧找到了一个错误? 请提交 [github issues](https://github.com/kataras/iris/issues) - 您是否有任何疑问或需要与有经验的人士交谈以实时解决问题? [加入我们的聊天](https://chat.iris-go.com) - [点击这里完成我们基于表单的用户体验报告](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/VERSION b/VERSION index b59967f3..b2996f61 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.2.0:https://github.com/kataras/iris/blob/master/HISTORY.md#th-08-february-2018--v1020 \ No newline at end of file +10.2.1:https://github.com/kataras/iris/blob/master/HISTORY.md#th-15-february-2018--v1021 \ No newline at end of file diff --git a/core/maintenance/version.go b/core/maintenance/version.go index 8f14615b..82648e6e 100644 --- a/core/maintenance/version.go +++ b/core/maintenance/version.go @@ -13,7 +13,7 @@ import ( const ( // Version is the string representation of the current local Iris Web Framework version. - Version = "10.2.0" + Version = "10.2.1" ) // CheckForUpdates checks for any available updates diff --git a/core/router/api_builder.go b/core/router/api_builder.go index da366245..e9afefba 100644 --- a/core/router/api_builder.go +++ b/core/router/api_builder.go @@ -617,6 +617,12 @@ func (api *APIBuilder) StaticEmbeddedHandler(vdir string, assetFn func(name stri // Examples: https://github.com/kataras/iris/tree/master/_examples/file-server func (api *APIBuilder) StaticEmbedded(requestPath string, vdir string, assetFn func(name string) ([]byte, error), namesFn func() []string) *Route { fullpath := joinPath(api.relativePath, requestPath) + // if subdomain, + // here we get the full path of the path only, + // because a subdomain can have parties as well + // and we need that path to call the `StripPrefix`. + _, fullpath = splitSubdomainAndPath(fullpath) + requestPath = joinPath(fullpath, WildcardParam("file")) h := api.StaticEmbeddedHandler(vdir, assetFn, namesFn) @@ -625,6 +631,7 @@ func (api *APIBuilder) StaticEmbedded(requestPath string, vdir string, assetFn f h = StripPrefix(fullpath, h) } + // it handles the subdomain(root Party) of this party as well, if any. return api.registerResourceRoute(requestPath, h) } @@ -705,19 +712,24 @@ func (api *APIBuilder) Favicon(favPath string, requestPath ...string) *Route { // // Returns the GET *Route. func (api *APIBuilder) StaticWeb(requestPath string, systemPath string) *Route { - paramName := "file" fullpath := joinPath(api.relativePath, requestPath) + // if subdomain, + // here we get the full path of the path only, + // because a subdomain can have parties as well + // and we need that path to call the `StripPrefix`. + _, fullpath = splitSubdomainAndPath(fullpath) - h := StripPrefix(fullpath, NewStaticHandlerBuilder(systemPath).Listing(false).Build()) + requestPath = joinPath(fullpath, WildcardParam(paramName)) + h := NewStaticHandlerBuilder(systemPath).Listing(false).Build() - handler := func(ctx context.Context) { - h(ctx) + if fullpath != "/" { + h = StripPrefix(fullpath, h) } - requestPath = joinPath(requestPath, WildcardParam(paramName)) - return api.registerResourceRoute(requestPath, handler) + // it handles the subdomain(root Party) of this party as well, if any. + return api.registerResourceRoute(requestPath, h) } // OnErrorCode registers an error http status code