go-zero
go-zero copied to clipboard
go-zero api WithNotFoundHandler & WithNotAllowedHandler 未兼容 WithCustomCors & WithCors
在 go-zero 中对 NotFoundHandler & NotAllowedHandler 的这种情况进行了封装
正常可到达请求返回 Header 如下
但是在请求 NotFoundHandler & NotAllowedHandler 不存在的链接时,没有出现 Cors Header 头信息,这样就会导致前端跨域报错,然后整个开发体验会不是很友好
@kevwan 目前我想到的有两种解决方案,一种是将用户注册的 Cors 在 NotFoundHandler & NotAllowedHandler 之前再运行一次,另外一种就是用户手动在自定义handler里面再处理一次 Cors,差不多跟下面类似
当然,最优雅的肯定是框架内部去解决这个问题
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I'll see if I can make a PR over the weekend. The implementation of this piece is really not elegant at the moment.
#2023
我有同样的问题
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
i have the same problem
@chowyu12 跟踪下这个PR合并进度就好了,不知道万总会不会在下一个版本调整 #2023
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@chowyu12 Just track the progress of this PR merge, I wonder if Wan will adjust it in the next version #2023
@chowyu12 跟踪下这个PR合并进度就好了,不知道万总会不会在下一个版本调整 #2023
I think so.
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@chowyu12 Just track the progress of this PR merge, I wonder if Wan will adjust it in the next version #2023
I think so.
This issue is stale because it has been open for 30 days with no activity.