Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload 404 not found #431

Closed
KiPSOFT-zz opened this issue Sep 17, 2016 · 16 comments
Closed

upload 404 not found #431

KiPSOFT-zz opened this issue Sep 17, 2016 · 16 comments

Comments

@KiPSOFT-zz
Copy link

Hi,

I think is issue. i'm upload the file but i'm getting error 404 not found.

node: 6.6.0
total.js: 2.0.1

server side;
framework.route('/crm/medya/dosyaYukle', dosyaYukle, ['upload', 'post'], 50000);

client side;

Request URL: http://crms.link/func/crm/medya/dosyaYukle
Request Method: POST
Status Code:404 Not Found
Remote Address: 192.168.7.55:80

Accept:/; q=0.5, application/json
Accept-Encoding:gzip, deflate
Accept-Language:tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Content-Length:191941
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryOCgT75JkRQFwkNWK
DNT:1
Host:crms.sanal.link
Origin:http://crms.link
Referer:http://crms.link/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.92 Safari/537.36

Request Payload
------WebKitFormBoundaryOCgT75JkRQFwkNWK
Content-Disposition: form-data; name="files"; filename="kara anons 1.mp3"
Content-Type: audio/mp3

Thanks.

@petersirka
Copy link
Collaborator

petersirka commented Sep 17, 2016

Hi @KiPSOFT,
func/ word is missing in the route URL:

http://crms.link/func/crm/medya/dosyaYukle
                     /crm/medya/dosyaYukle

Thank you.
PS: remove post flag, is useless.

@KiPSOFT-zz
Copy link
Author

KiPSOFT-zz commented Sep 17, 2016

Oh sorry peter for missing information. func is apache proxy reverse definition. any /func request to total.js server. so same url.

@petersirka
Copy link
Collaborator

I understand but HTTP protocol sends a full relative url address, so Total.js sees:

/func/crm/medya/dosyaYukle

Try to create route with func or update configlike this:

default-root      : /func/

https://docs.totaljs.com/latest/en.html#api~FrameworkConfiguration~default-root

@KiPSOFT-zz
Copy link
Author

this only apply to upload request? beacuse i have almost 200 route and working properly one year ago.

@petersirka
Copy link
Collaborator

only I assume ... Try it and give me a feedback.

@KiPSOFT-zz
Copy link
Author

i'm trying.

@KiPSOFT-zz
Copy link
Author

this time each request 403 returns.

@petersirka
Copy link
Collaborator

I have to look into the code or can you create a small example?

@KiPSOFT-zz
Copy link
Author

i'm test new example behind on apache and non apache working properly. i dont understand. i'm searching problem my project. sorry.

@KiPSOFT-zz
Copy link
Author

i found it peter. (i spent 3 hours)

you know i'm added this code in auth module;

 self.onAuthorize(id, function(user) {

            if (!user || !options.autoLogin) {
                res.cookie(options.cookie, '', new Date().add('d', -1));
                callback(false);
                return;
            }

            user.yetkiler.forEach(function(item) {
                flags.push('@' + item.yetki_id);
            });

this code add user permissions as role to route. my upload route without any role although return 404. i'm remove this code in auth module;

user.yetkiler.forEach(function(item) {
                flags.push('@' + item.yetki_id);
            });

working perfect. what do you think ? this is a bug ?

@petersirka
Copy link
Collaborator

Can I see a full declaration of a route?

@KiPSOFT-zz
Copy link
Author

Sure framework.route ('/crm/dosyaYukle', ['upload'], 500000);

1 similar comment
@KiPSOFT-zz
Copy link
Author

Sure framework.route ('/crm/dosyaYukle', ['upload'], 500000);

@KiPSOFT-zz
Copy link
Author

Sure

framework.route ('/crm/dosyaYukle', ['upload'], 500000);

@petersirka
Copy link
Collaborator

@KiPSOFT sorry for delay. Please try to remove authorization, does it work? Are you sure that the request is directed correctly into the route? I mean on a problem with the Apache... Thank you.

@KiPSOFT-zz
Copy link
Author

i've test behind apache and not behind apache. problem reason not apache. i sent test project your e-mail. please test this steps;

  1. open url and select upload files. you see request return 200 in chrome developer tools
  2. click login button and try again upload file, you see request return 404 error.
  3. mark this code;
    flags.push('@1420');

in definitions/default.js.
4. try again upload file you see request return 200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants