Comments (14)
While true, I'm not sure how to handle it. I think it should be headers as a whole that you should be able to set before replying, not just cookies. I'll have to think a little more on replies before deciding. That's something I'll probably look at in the next two weeks considering it'll make the REST code clearer.
from cowboy.
Take a look at this: https://github.com/erlyvideo/cowboy/commit/a3fb66de497abea8390ba72ddf0d2a8969ff021e
On Nov 6, 2011, at 3:03 PM, Loïc Hoguin wrote:
While true, I'm not sure how to handle it. I think it should be headers as a whole that you should be able to set before replying, not just cookies. I'll have to think a little more on replies before deciding. That's something I'll probably look at in the next two weeks considering it'll make the REST code clearer.
Reply to this email directly or view it on GitHub:
#87 (comment)
Max Lapshin
http://erlyvideo.org/
+7 906 711-11-14
skype: max_lapshin
from cowboy.
Yeah, but I'm not sure about the API I want, and I'll need some time to think about it. (Same goes for some other things you showed me at the conference.)
from cowboy.
I'll be adding functions to set headers, cookies, body of the reply (full for now, we'll see later for more options) and also inquire whether one of those is set. I should have a patch for that next week in the worst case. I'll see if I can take your code when I get to it.
from cowboy.
Oook.
After this I'll try to help you somehow with file upload. I need it in my rack module.
from cowboy.
Right. I have no idea about the status of file upload. I'll ask tomorrow. I'm mainly focusing on REST as I'm trying to finish it for next week (and need those functions to do it). Wish I had more time but we're still having a deadline so I probably won't be able to get back to your couple other ideas/inquiries before a couple weeks. :)
from cowboy.
Not a problem.
What are you going to implement in REST support? Some decision core, like in Rails or in webmachine?
from cowboy.
Webmachine's decision core, with a few minor tweaks and additions (nothing big). There's another ticket about it: #11
from cowboy.
Looking at your code I see there can be multiple Set-Cookie headers generated. I'm not sure if this would work with lists:ukeymerge like this, as it expects lists to have no duplicates. Obviously the code for this should change and I'm working on it at the moment, but I thought you might want to know in case you notice disappearing cookies.
from cowboy.
Forgot to ping you to inform you that while set_resp_cookie isn't in, at least set_body and set_resp_header are in, the latter allowing you to set cookies too (without needing a fork to do it).
from cowboy.
Ook, I'll take a look.
Haven't you looked at this commit? https://github.com/erlyvideo/cowboy/commit/66895faeeb7ac9afa4501dc2fd4e9ab4e23f23d3
from cowboy.
I haven't looked at any commit yet, I'm still quite busy. I'll take a look after I commit REST next week. Looks good though and it's fairly important to have.
from cowboy.
I'll add set_resp_cookie (aliasing cookie/3 and set_resp_header/3 joined together pretty much) and your peer_addr function tomorrow morning.
from cowboy.
Added set_resp_cookie/4 in ce92ab1.
I'd like to add your peer_addr function too but I think it should return an IP as an Erlang tuple like the function peer is doing, for consistency. Can you make the changes required and open a new ticket for it?
I'm closing this one since the change has been pushed. Thanks!
from cowboy.
Related Issues (20)
- OPTIONS not working in cowboy_rest HOT 4
- Redirect fails with HTTP2 HOT 3
- Upload large files fails HOT 3
- Release a new cowboy with updated cowlib HOT 6
- Performance of POST body processing speed is 10x slower in Cowboy 2.10.0 compared to 1.1.2 HOT 3
- rate_limited is after forbidden HOT 1
- HTTP/1.1 connection upgraded to HTTP/2 has old cowboy_req:version/1 HOT 4
- Is Cowboy affected by the HTTP/2 Rapid Reset attack? HOT 16
- Cowboy/ranch protocol that can serve plain text and secure requests from the same port to different handlers
- Docs for `cowboy_stream` module include broken links HOT 2
- Reject responses that have explicit set-cookie HOT 7
- gunsmoke = gun + cowboy + tls + websocket HOT 3
- when use cowboy:start_tls can not connect HOT 7
- cowboy_clear's protocols option
- Document range requests in cowboy_rest and cowboy_static HOT 1
- 2.10 Getting Started: Makefile issue -- No rule to make target 'run' HOT 2
- Rewrite ws_autobahn to no longer use autobahn-testsuite HOT 2
- I want to use Cowboy 2.11's Websocket over HTTP/2 feature, How do I configure nginx HOT 2
- Apply routing constraint to […] bind? HOT 3
- Is cowboy affected by CVE-2023-46118 ? 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 cowboy.