Comments (5)
刚更新了版本,把这个一同添加了
Response.CookieSecure有这个属性设置
from fasthttpapi.
继承OptionsAttribute类重写SetResponse,自己把内容加到输出头上
以下是默认实现
public virtual void SetResponse(HttpRequest request, HttpResponse response)
{
HttpApiServer server = request.Server;
if (server.EnableLog(EventArgs.LogType.Debug))
server.Log(EventArgs.LogType.Debug, request.Session, $"{request.RemoteIPAddress} {request.Method} {request.Url} set options");
response.Header["Access-Control-Allow-Origin"] = AllowOrigin;
}
from fasthttpapi.
CookieSecure
感谢大佬回复,目前还有个问题,
AllowCredentials = "true" 目前FastHttpApi只回复OPTIONS请求,而POST或者GET(允许的请求)没有附带这个头
如果再次POST的时候,会收到如下提示:
这个错误是服务器没返回AllowCredentials = "true" ,应该是所有请求都要包含这个
from fasthttpapi.
在控制上标记OptionsAttribute属性,在get或post请求时会输出的
from fasthttpapi.
onsAttribute类重写SetResponse,自己把内容加到输出头上
以下是默认实现
感谢大佬给出解决方案,希望大佬下次有空的时候更新下AllowCredentials = "true" ,在除了"OPTIONS"之外的请求附带这个头(如果设置了的话)
from fasthttpapi.
Related Issues (20)
- 关于注入问题的疑问 HOT 2
- 如何禁止ServerController? HOT 2
- Options 选项 AllowCredentials 无法设置 HOT 4
- 请问这类错误怎么排查: <send data completed error> HOT 1
- 大佬,为什么接收消息之后,buffer不释放 HOT 3
- 大佬,为什么配置了https之后,服务器返回的是403
- 可以更新到net core 7吗?
- 升级到net6或者net7 HOT 1
- Upload File Problem!
- CROS an Cookie Problem HOT 2
- WebSocket连接时能否传递参数
- 高版本不再开源了对吧?
- 我自定义了DataConvertAttribute 但并没有走。还是走的jsonDataConvert
- Wpf应用中集成FastHttpApi会导致Wpf弹窗问题,找不到xxx.resources.dll
- Accessing HttpRequest without route/map
- after update beetlex cannot run program with release mode HOT 1
- 有计划支持net core 8 吗
- how to add brotli compression ?
- 没有找到合适的方法去重写 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fasthttpapi.