Code Monkey home page Code Monkey logo

Comments (14)

essen avatar essen commented on May 9, 2024

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.

maxlapshin avatar maxlapshin commented on May 9, 2024

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.

essen avatar essen commented on May 9, 2024

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.

essen avatar essen commented on May 9, 2024

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.

maxlapshin avatar maxlapshin commented on May 9, 2024

Oook.

After this I'll try to help you somehow with file upload. I need it in my rack module.

from cowboy.

essen avatar essen commented on May 9, 2024

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.

maxlapshin avatar maxlapshin commented on May 9, 2024

Not a problem.

What are you going to implement in REST support? Some decision core, like in Rails or in webmachine?

from cowboy.

essen avatar essen commented on May 9, 2024

Webmachine's decision core, with a few minor tweaks and additions (nothing big). There's another ticket about it: #11

from cowboy.

essen avatar essen commented on May 9, 2024

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.

essen avatar essen commented on May 9, 2024

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.

maxlapshin avatar maxlapshin commented on May 9, 2024

Ook, I'll take a look.

Haven't you looked at this commit? https://github.com/erlyvideo/cowboy/commit/66895faeeb7ac9afa4501dc2fd4e9ab4e23f23d3

from cowboy.

essen avatar essen commented on May 9, 2024

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.

essen avatar essen commented on May 9, 2024

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.

essen avatar essen commented on May 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.