-
Notifications
You must be signed in to change notification settings - Fork 83
How to stop appending 'null' to the url? #97
Comments
Ahah! Good one! It comes from your |
@pyrsmk I will test in a couple of hours when I'm home from work. So what I noticed was:
This causes null to be in the URL, even if you have no options. So I figured, because caching is off by default, this should be appending a timestamp. But it actually appends null. So I thought I'll set it to be cachable, which then forced me to put I assume that's the issue you've just fixed? I think the former may be an issue too. Also if you do:
That causes the URL to generate with |
Yes, the last two bugs you're mentioning should be fixed by now. But the first surely comes from another place. Weird... What browser are you using? |
Using Chrome latest version. On Windows 10. I'll verify all when I get home and let you know. |
As reading the code, I think that the first bug should be fixed too with the last commit. In fact, qwest does not have cache busting anymore with a |
Hmm the reason I picked this up was last night I saw cache control no cache being sent to aws gateway api. Even after setting cache true. I just looked at the commit and it looks like it does solve both the first issues. |
It looks like the code sets the cache control header correctly when cache is set to false. Maybe I imagined it. I shall verify! |
Ahah ok! Everything seems to be fine by now! I'll wait for your confirmation. Anyway, thanks a lot for your contribution ;) |
Ah thank you for creating an awesome lib. The bug is still occurring, I'm trying to figure out why. Had to hack up the |
FOUND IT! https://github.com/pyrsmk/qwest/blob/master/src/qwest.js#L310 This line is turning it to a string |
Updated it to |
Thanks a lot! I'm fixing this |
Ah... I wasn't aware of that automatic closing according to a commit label... Can you test if you have time? ^^ |
Saw the commit in email. Just finished testing, updated via npm, using the .min, worked PERFECTLY! :D Now, I just need to figure out why saying |
Wut Oo What are your other options for the request? |
That's it. |
I can't understand why qwest is still setting this header, it should not be the case if cache is set to true... There is just two lines for that in the source. Can you put a |
It doesn't hit that line at all. It only sets it in Chrome, it doesn't hit that line at all. It's like the browser is adding it, but the W3 spec says:
So confusing, I don't believe this issue is with qwest. I'll try and figure it out tho :( |
It's only happening in Chrome? What the hell... Is your request using CORS? |
Yes, it's using CORS, but the cache time is 1 hour so I wonder if it has cached the no-cache headers from before. I'll have to wait it out and see. |
Only the request body is cached. I think this bug could be related to #90 edit : my last comment could be a temporary fix to your problem (probably) |
When CORS you have a preflight
|
Ah, I didn't know that. CORS requests are a bit complicated. |
@pyrsmk can confirm, it was cached on the options. Today I'm not getting any |
Great! |
Any request I make, i.e:
Ends up calling:
https://mysite.com/stuff?null
How can I stop it from adding
?null
to the url?I forgot to mention, I have set
cache: true
and using latest version, it still appends the null and prevents caching.The text was updated successfully, but these errors were encountered: